'Undefined reference to'; probably makefile mistake

hi there,

I'm new to this forum, so please accept my apologies up front.

And here is the problem I was fighting for few days:

I'm trying to compile "Hypertable" client example to see if I have set up development environment correctly.

I have makefile:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# the actual link line can be obtained from cmake generated makefile
# (use make VERBOSE=1 in build tree to find out)
BOOST_INCLUDE_DIR=/usr/include/boost
BOOST_THREAD_LIB=boost_thread
BOOST_IOSTREAMS_LIB=boost_iostreams
BOOST_PROGRAM_OPTIONS_LIB=boost_program_options
BOOST_SYSTEM_LIB=boost_system
SIGAR_LIB=sigar-x86-linux
HYPERTABLE_INSTALL_DIR=/opt/hypertable/0.9.5.0.pre6

CFLAGS=-g -I$(BOOST_INCLUDE_DIR) -I$(HYPERTABLE_INSTALL_DIR)/include -I/usr/local/BerkeleyDB.5.2/include
LDFLAGS=-L$(HYPERTABLE_INSTALL_DIR)/lib -lHypertable -lHyperComm -lHyperCommon -lHyperTools -llog4cpp -lexpat -l$(BOOST_THREAD_LIB) -l$(BOOST_IOSTREAMS_LIB) -l$(BOOST_PROGRAM_OPTIONS_LIB) -l$(BOOST_SYSTEM_LIB) -l$(SIGAR_LIB) -lHyperspace -lz -lcurses

all: apache_log_load apache_log_query conf/hypertable.cfg

conf/hypertable.cfg:
	-mkdir conf
	-cp $(HYPERTABLE_INSTALL_DIR)/conf/hypertable.cfg conf

apache_log_load: apache_log_load.o
	g++ -o apache_log_load apache_log_load.o $(LDFLAGS)

apache_log_load.o: apache_log_load.cc
	g++ $(CFLAGS) -c apache_log_load.cc

apache_log_query: apache_log_query.o
	g++ -o apache_log_query apache_log_query.o $(LDFLAGS)

apache_log_query.o: apache_log_query.cc
	g++ $(CFLAGS) -c apache_log_query.cc

clean:
	-rm apache_log_load apache_log_query *.o


When I am trying to run i receive a wall of error messages which look like this:


./apache_log/apache_log_load.o: In function `main':
apache_log_load.cc:(.text+0x517): undefined reference to `Hypertable::System::locate_install_dir(char const*)'
apache_log_load.cc:(.text+0x544): undefined reference to `Hypertable::Client::Client(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
apache_log_load.cc:(.text+0x5c6): undefined reference to `Hypertable::Client::open_namespace(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Hypertable::Namespace*)'
apache_log_load.cc:(.text+0x66b): undefined reference to `Hypertable::Namespace::open_table(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
apache_log_load.cc:(.text+0x6de): undefined reference to `Hypertable::Table::create_mutator(unsigned int, unsigned int, unsigned int)'
apache_log_load.cc:(.text+0x756): undefined reference to `Hypertable::ApacheLogParser::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
apache_log_load.cc:(.text+0xb2d): undefined reference to `Hypertable::ApacheLogParser::next(Hypertable::ApacheLogEntry&)'
apache_log_load.cc:(.text+0xd65): undefined reference to `Hypertable::Logger::logger'
apache_log_load.cc:(.text+0xdbc): undefined reference to `Hypertable::Logger::show_line_numbers'
apache_log_load.cc:(.text+0xe3e): undefined reference to `Hypertable::operator<<(std::basic_ostream<char, std::char_traits<char> >&, Hypertable::Exception const&)'
apache_log_load.cc:(.text+0xe53): undefined reference to `Hypertable::Logger::logger'
apache_log_load.cc:(.text+0xe80): undefined reference to `Hypertable::Logger::logger'
apache_log_load.cc:(.text+0xf6e): undefined reference to `Hypertable::Logger::logger'
apache_log_load.cc:(.text+0xfc5): undefined reference to `Hypertable::Logger::show_line_numbers'
apache_log_load.cc:(.text+0x1047): undefined reference to `Hypertable::operator<<(std::basic_ostream<char, std::char_traits<char> >&, Hypertable::Exception const&)'
apache_log_load.cc:(.text+0x105c): undefined reference to `Hypertable::Logger::logger'
apache_log_load.cc:(.text+0x1089): undefined reference to `Hypertable::Logger::logger'


I have tried a set of things, but nothing helped. Probably I'm missing something, but I really don't know what. I'm new to makefile so I guess the problem lays in here.

The code is downloaded together with the " hypertable database" it self from http://hypertable.com and it seems others did not have much problems running.

Thank you so much for your help

Edgar
that is a link error

please ensure that the libraries listed on Line 12 exist in

/opt/hypertable/0.9.5.0.pre6/lib
Thanks, that helped.
Topic archived. No new replies allowed.