[hypertable-user] Hypertable Example

181 views
Skip to first unread message

Zhuo Yin

unread,
Apr 23, 2010, 12:21:52 AM4/23/10
to hyperta...@googlegroups.com
Hi, all:

I downloaded the latest version of Hypertable 0.9.3.1-alpha, and trying to write a very simple c++ client test program and run it on Fedora 12.

What I want to do is just try to run sample code.

I met the problem probably the static library cannot to linked, which bothers me a lot:
Here is my test code:
========================================================
#include <Common/Compat.h>

#include <iostream>
#include <fstream>
#include <string>

#include <Common/System.h>
#include <Common/Error.h>

#include <Hypertable/Lib/Client.h>
#include <Hypertable/Lib/KeySpec.h>

using namespace Hypertable;

int main(int argc, char* argv[]) {
ClientPtr client_ptr;
TablePtr table_ptr;
TableMutatorPtr mutator_ptr;
KeySpec key;

const char* install_dir = "/opt/hypertable/current/";

client_ptr = new Client( System::locate_install_dir(install_dir) );

return 0;
}
==========================================================

g++ -g -Wall -fPIC -I/usr/include -I/usr/include/python2.6 -I/opt/hypertable/current/include/ -c test.cpp -Wno-deprecated -o test.o
g++ -L/usr/lib64 -L/opt/hypertable/current/lib/ -o test -lHypertable -lHyperComm -lHyperCommon -lHypertable test.o
test.o: In function `main':
/home/zyin/ht-dev/test.cpp:23: undefined reference to `Hypertable::System::locate_install_dir(char const*)'
/home/zyin/ht-dev/test.cpp:23: undefined reference to `Hypertable::Client::Client(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
collect2: ld returned 1 exit status
make: *** [test] Error 1


I got this problem above, it seems the object file compiled fine, but cannot find the functions in static libraries when linking. Is there any special version requirement to compile the simple client program?

Can someone give me a hint? It's hard to compile from source tar ball, if I can get those compiled binaries works, that's the best

Thanks,
Zhuo Yin


--
You received this message because you are subscribed to the Google Groups "Hypertable User" group.
To post to this group, send email to hyperta...@googlegroups.com.
To unsubscribe from this group, send email to hypertable-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hypertable-user?hl=en.

Doug Judd

unread,
Apr 24, 2010, 1:53:28 PM4/24/10
to hyperta...@googlegroups.com
Hi Zhuo,

I'm not sure exactly what is going on here.  The symbols 'Hypertable::System::locate_install_dir' and 'Hypertable::Client::Client' should be found in libHyperCommon and libHypertable, respectively.  Is it possible that this is a link line ordering problem?  Maybe try changing this:

g++ -L/usr/lib64 -L/opt/hypertable/current/lib/ -o test -lHypertable -lHyperComm -lHyperCommon -lHypertable test.o

to this:

g++ -L/usr/lib64 -L/opt/hypertable/current/lib/ -o test -lHyperCommon -lHypertable -lHyperComm -lHyperCommon -lHypertable test.o

and see if that fixes the problem.

- Doug

Zhuo Yin

unread,
Apr 25, 2010, 3:10:34 PM4/25/10
to hyperta...@googlegroups.com
Hi, Doug:

Thanks for reply.

I tried your suggestion:

g++ -g -Wall -fPIC -I/usr/include -I/usr/include/python2.6 -I/opt/hypertable/current/include  -c test.cpp -Wno-deprecated -o test.o
g++ -L/usr/lib64 -L/opt/hypertable/current/lib -o test -lHyperCommon -lHypertable -lHyperComm -lHyperCommon test.o 
test.o: In function `main':
/home/zyin/ht-dev/test.cpp:23: undefined reference to `Hypertable::System::locate_install_dir(char const*)'
/home/zyin/ht-dev/test.cpp:23: undefined reference to `Hypertable::Client::Client(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
collect2: ld returned 1 exit status
make: *** [test] Error 1

I still got this.
The package I installed is hypertable-0.9.3.1-linux-x86_64.rpm,  because I'm using Fedora 12 x86_64 system.

$ ls /opt/hypertable/current/lib/
java                                libcrypto.so.0.9.8  libHyperCommon.a     libHyperThrift.a        libsigar-amd64-linux.so   libz.so.1
libboost_filesystem.so.1.40.0       libdb_cxx-4.8.so    libHyperDfsBroker.a  libHyperThriftConfig.a  libssl.so.0.9.8           perl
libboost_program_options.so.1.40.0  libevent-1.3e.so.1  libHyperDfsCmds.a    libHyperTools.a         libstdc++.so.6            php
libboost_system.so.1.40.0           libexpat.so.1       libHyperRanger.a     liblog4cpp.so.5         libtcmalloc_minimal.so.0  py
libboost_thread.so.1.40.0           libgcc_s.so.1       libHyperspace.a      libncurses.so.5         libthriftnb.so.0          rb
libceph.so.1                        libHyperComm.a      libHypertable.a      libreadline.so.5        libthrift.so.0

I was wondering, is there any problem with the static 64bit rpm package?

Thanks,
Zhuo Yin

Doug Judd

unread,
Apr 26, 2010, 9:37:08 AM4/26/10
to hyperta...@googlegroups.com
Hi Zhuo,

There is a tool called 'nm' that will dump the symbol table for an object file or library archive.  It should ship with Fedora by default.  Try running nm on libHyperCommon and libHypertable and grepping for these two symbols to see if they exist in the libraries.

- Doug

Zhuo Yin

unread,
Apr 26, 2010, 11:42:20 AM4/26/10
to hyperta...@googlegroups.com
Hi, Doug:

Here is the output:

$ nm /opt/hypertable/current/lib/libHyperCommon.a | grep System.*locate
0000000000001320 T _ZN10Hypertable6System18locate_install_dirEPKc
00000000000002b0 T _ZN10Hypertable6System19_locate_install_dirEPKc

$ nm /opt/hypertable/current/lib/libHypertable.a | grep Client.*Client
00000000000045e0 t _ZN89_GLOBAL__N__root_src_hypertable_src_cc_Hypertable_Lib_HqlInterpreter.cc_00000000_F830E88E10cmd_selectEPN10Hypertable6ClientERN5boost13intrusive_ptrINS0_17ConnectionManagerEEERNS4_INS0_9DfsBroker6ClientEEERNS0_3Hql11ParserStateERNS0_14HqlInterpreter8CallbackE
0000000000001410 t _ZN89_GLOBAL__N__root_src_hypertable_src_cc_Hypertable_Lib_HqlInterpreter.cc_00000000_F830E88E13cmd_load_dataEPN10Hypertable6ClientEjRN5boost13intrusive_ptrINS0_17ConnectionManagerEEERNS4_INS0_9DfsBroker6ClientEEERNS0_3Hql11ParserStateERNS0_14HqlInterpreter8CallbackE
00000000000033d0 t _ZN89_GLOBAL__N__root_src_hypertable_src_cc_Hypertable_Lib_HqlInterpreter.cc_00000000_F830E88E14cmd_dump_tableEPN10Hypertable6ClientERN5boost13intrusive_ptrINS0_17ConnectionManagerEEERNS4_INS0_9DfsBroker6ClientEEERNS0_3Hql11ParserStateERNS0_14HqlInterpreter8CallbackE
0000000000000fe0 r _ZZN89_GLOBAL__N__root_src_hypertable_src_cc_Hypertable_Lib_HqlInterpreter.cc_00000000_F830E88E13cmd_load_dataEPN10Hypertable6ClientEjRN5boost13intrusive_ptrINS0_17ConnectionManagerEEERNS4_INS0_9DfsBroker6ClientEEERNS0_3Hql11ParserStateERNS0_14HqlInterpreter8CallbackEE19__PRETTY_FUNCTION__
0000000000001140 r _ZZN89_GLOBAL__N__root_src_hypertable_src_cc_Hypertable_Lib_HqlInterpreter.cc_00000000_F830E88E14cmd_dump_tableEPN10Hypertable6ClientERN5boost13intrusive_ptrINS0_17ConnectionManagerEEERNS4_INS0_9DfsBroker6ClientEEERNS0_3Hql11ParserStateERNS0_14HqlInterpreter8CallbackEE19__PRETTY_FUNCTION__

in libHyperCommon.a, it seems I can find Hypertable::System::locate_install_dir, but for all libHypertable.a, libHyperComm.a, libHyperCommon.a, I can't find the  Hypertable::Client::Client

But why the ld cannot find the `Hypertable::System::locate_install_dir(char const*)', and where is Hypertable::Client::Client.

Thanks,
Zhuo Yin

Doug Judd

unread,
Apr 26, 2010, 12:08:31 PM4/26/10
to hyperta...@googlegroups.com
Hi Zhuo,

When I inspect the libraries, it appears that the symbols are there.  Here's what I did:


$ tar xjvf hypertable-0.9.3.1-linux-x86_64.tar.bz2 

$ nm hypertable-0.9.3.1-linux-x86_64/opt/hypertable/0.9.3.1/lib/libHypertable.a | c++filt | fgrep "Hypertable::Client::Client"
0000000000005c20 T Hypertable::Client::Client(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)
00000000000052e0 T Hypertable::Client::Client(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)
0000000000006210 T Hypertable::Client::Client(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)
0000000000005780 T Hypertable::Client::Client(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)

$ nm hypertable-0.9.3.1-linux-x86_64/opt/hypertable/0.9.3.1/lib/libHyperCommon.a | c++filt | fgrep "Hypertable::System::locate_install_dir"
0000000000001320 T Hypertable::System::locate_install_dir(char const*)

The 'T' indicates that the symbol is in the text (code) section.

- Doug

Zhuo Yin

unread,
Apr 26, 2010, 2:41:36 PM4/26/10
to hyperta...@googlegroups.com
Doug:

Thanks for the command,

I did the same thing as you did. The command output is the same. seems the library has such functions.

But I don't know why it cannot be linked. I changed the order of g++ command line but still get no luck, which really bothers me. Do you have any suggestion for this?

Regards,
Zhuo Yin (917)215-8740
Gentoo Linux Fan - int (*(*(*pFile)())[10])();

Luke

unread,
Apr 26, 2010, 2:47:11 PM4/26/10
to hyperta...@googlegroups.com
The easiest way to find out the link line for a test program would be
leverage the cmake. Go to the examples build directory and type make
clean and make VERBOSE=1

Zhuo Yin

unread,
Apr 27, 2010, 2:44:49 PM4/27/10
to hyperta...@googlegroups.com
Hi, Doug, Luke:

1. I tried go to /opt/hypertable/current/examples

I edited CMakeCache.txt:
changed
CMAKE_CXX_FLAGS:STRING
to
CMAKE_CXX_FLAGS:STRING=-I/opt/hypertable/current/include/

and
CMAKE_EXE_LINKER_FLAGS:STRING
to
CMAKE_EXE_LINKER_FLAGS:STRING=-L/opt/hypertable/current/lib

then execute:
$ make clean
$ make VERBOSE=1

Here is the error message I got, it's the same link problem as I got from my previous Makefile example:

/usr/bin/cmake -H/opt/hypertable/current/examples/apache_log -B/opt/hypertable/current/examples/apache_log --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /opt/hypertable/current/examples/apache_log/CMakeFiles /opt/hypertable/current/examples/apache_log/CMakeFiles/progress.make
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/opt/hypertable/0.9.3.1/examples/apache_log'
make -f CMakeFiles/apache_log_load.dir/build.make CMakeFiles/apache_log_load.dir/depend
make[2]: Entering directory `/opt/hypertable/0.9.3.1/examples/apache_log'
cd /opt/hypertable/current/examples/apache_log && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /opt/hypertable/current/examples/apache_log /opt/hypertable/current/examples/apache_log /opt/hypertable/current/examples/apache_log /opt/hypertable/current/examples/apache_log /opt/hypertable/current/examples/apache_log/CMakeFiles/apache_log_load.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/opt/hypertable/0.9.3.1/examples/apache_log'
make -f CMakeFiles/apache_log_load.dir/build.make CMakeFiles/apache_log_load.dir/build
make[2]: Entering directory `/opt/hypertable/0.9.3.1/examples/apache_log'
/usr/bin/cmake -E cmake_progress_report /opt/hypertable/current/examples/apache_log/CMakeFiles 1
[ 50%] Building CXX object CMakeFiles/apache_log_load.dir/apache_log_load.cc.o
/usr/lib64/ccache/c++    -I/opt/hypertable/current/include/   -o CMakeFiles/apache_log_load.dir/apache_log_load.cc.o -c /opt/hypertable/current/examples/apache_log/apache_log_load.cc
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.2/../../../../include/c++/4.4.2/backward/hash_map:59,
                 from /opt/hypertable/current/include/Common/HashMap.h:24,
                 from /opt/hypertable/current/include/AsyncComm/ApplicationQueue.h:34,
                 from /opt/hypertable/current/include/Hypertable/Lib/Client.h:29,
                 from /opt/hypertable/current/examples/apache_log/apache_log_load.cc:31:
/usr/lib/gcc/x86_64-redhat-linux/4.4.2/../../../../include/c++/4.4.2/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
Linking CXX executable apache_log_load
/usr/bin/cmake -E cmake_link_script CMakeFiles/apache_log_load.dir/link.txt --verbose=1
/usr/lib64/ccache/c++   -I/opt/hypertable/current/include/  -fPIC -L/opt/hypertable/current/lib CMakeFiles/apache_log_load.dir/apache_log_load.cc.o  -o apache_log_load -rdynamic -lHypertable
CMakeFiles/apache_log_load.dir/apache_log_load.cc.o: In function `(anonymous namespace)::format_timestamp(tm)':
apache_log_load.cc:(.text+0x1ec): undefined reference to `Hypertable::format(char const*, ...)'
CMakeFiles/apache_log_load.dir/apache_log_load.cc.o: In function `(anonymous namespace)::report_error(Hypertable::Exception&)':
apache_log_load.cc:(.text+0x235): undefined reference to `Hypertable::Error::get_text(int)'
CMakeFiles/apache_log_load.dir/apache_log_load.cc.o: In function `(anonymous namespace)::handle_mutation_failure(boost::intrusive_ptr<Hypertable::TableMutator>&)':
apache_log_load.cc:(.text+0x3af): undefined reference to `Hypertable::Error::get_text(int)'
CMakeFiles/apache_log_load.dir/apache_log_load.cc.o: In function `main':
apache_log_load.cc:(.text+0xbca): undefined reference to `Hypertable::operator<<(std::basic_ostream<char, std::char_traits<char> >&, Hypertable::Exception const&)'
apache_log_load.cc:(.text+0xcc6): undefined reference to `Hypertable::operator<<(std::basic_ostream<char, std::char_traits<char> >&, Hypertable::Exception const&)'
CMakeFiles/apache_log_load.dir/apache_log_load.cc.o:(.gcc_except_table+0x190): undefined reference to `typeinfo for Hypertable::Exception'
/opt/hypertable/current/lib/libHypertable.a(ApacheLogParser.cc.o): In function `boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_decompressor_impl<std::allocator<char> >, std::allocator<char> >::impl>::dispose()':
ApacheLogParser.cc:(.text._ZN5boost6detail17sp_counted_impl_pINS_9iostreams16symmetric_filterINS2_6detail22zlib_decompressor_implISaIcEEES6_E4implEE7disposeEv[boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_decompressor_impl<std::allocator<char> >, std::allocator<char> >::impl>::dispose()]+0x2d): undefined reference to `boost::iostreams::detail::zlib_base::reset(bool, bool)'
ApacheLogParser.cc:(.text._ZN5boost6detail17sp_counted_impl_pINS_9iostreams16symmetric_filterINS2_6detail22zlib_decompressor_implISaIcEEES6_E4implEE7disposeEv[boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_decompressor_impl<std::allocator<char> >, std::allocator<char> >::impl>::dispose()]+0x35): undefined reference to `boost::iostreams::detail::zlib_base::~zlib_base()'
ApacheLogParser.cc:(.text._ZN5boost6detail17sp_counted_impl_pINS_9iostreams16symmetric_filterINS2_6detail22zlib_decompressor_implISaIcEEES6_E4implEE7disposeEv[boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost::iostreams::detail::zlib_decompressor_impl<std::allocator<char> >, std::allocator<char> >::impl>::dispose()]+0x66): undefined reference to `boost::iostreams::detail::zlib_base::~zlib_base()'
/opt/hypertable/current/lib/libHypertable.a(ApacheLogParser.cc.o): In function `boost::iostreams::basic_gzip_decompressor<std::allocator<char> >::make_params(int)':
ApacheLogParser.cc:(.text._ZN5boost9iostreams23basic_gzip_decompressorISaIcEE11make_paramsEi[boost::iostreams::basic_gzip_decompressor<std::allocator<char> >::make_params(int)]+0x49): undefined reference to `boost::iostreams::zlib::default_compression'
ApacheLogParser.cc:(.text._ZN5boost9iostreams23basic_gzip_decompressorISaIcEE11make_paramsEi[boost::iostreams::basic_gzip_decompressor<std::allocator<char> >::make_params(int)]+0x6e): undefined reference to `boost::iostreams::zlib::deflated'
ApacheLogParser.cc:(.text._ZN5boost9iostreams23basic_gzip_decompressorISaIcEE11make_paramsEi[boost::iostreams::basic_gzip_decompressor<std::allocator<char> >::make_params(int)]+0x77): undefined reference to `boost::iostreams::zlib::default_strategy'
/opt/hypertable/current/lib/libHypertable.a(ApacheLogParser.cc.o): In function `void boost::iostreams::close<boost::iostreams::basic_gzip_decompressor<std::allocator<char> >, boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >(boost::iostreams::basic_gzip_decompressor<std::allocator<char> >&, boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> >&, std::_Ios_Openmode)':
ApacheLogParser.cc:(.text._ZN5boost9iostreams5closeINS0_23basic_gzip_decompressorISaIcEEENS0_6detail16linked_streambufIcSt11char_traitsIcEEEEEvRT_RT0_St13_Ios_Openmode[void boost::iostreams::close<boost::iostreams::basic_gzip_decompressor<std::allocator<char> >, boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >(boost::iostreams::basic_gzip_decompressor<std::allocator<char> >&, boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> >&, std::_Ios_Openmode)]+0x81): undefined reference to `boost::iostreams::detail::zlib_base::before(char const*&, char const*, char*&, char*)'


2. another separate issue regarding thrift python client:

Here is how I run the sample code, I started the local server before running this python program:

$ cd /opt/hypertable/current/lib/py
$ PYTHONPATH=gen-py python client_test.py
HQL examples
/opt/hypertable/0.9.3.1/lib/py/gen-py/hyperthrift/gen/ttypes.py:973: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  self.message = message
/opt/hypertable/0.9.3.1/lib/py/gen-py/hyperthrift/gen/ttypes.py:991: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  self.message = iprot.readString();
(<class 'hyperthrift.gen.ttypes.ClientException'>, ClientException(code=65538), <traceback object at 0x7f8db115bef0>)
Traceback (most recent call last):
  File "client_test.py", line 9, in <module>
    res = client.hql_query("show tables")
  File "/opt/hypertable/0.9.3.1/lib/py/gen-py/hyperthrift/gen2/HqlService.py", line 141, in hql_query
    return self.recv_hql_query()
  File "/opt/hypertable/0.9.3.1/lib/py/gen-py/hyperthrift/gen2/HqlService.py", line 164, in recv_hql_query
    raise result.e
hyperthrift.gen.ttypes.ClientException: ClientException(code=65538)


It's not working either.


Regards,
Zhuo Yin (917)215-8740
Gentoo Linux Fan - int (*(*(*pFile)())[10])();


Kevin Yuan

unread,
Apr 27, 2010, 11:19:44 PM4/27/10
to Hypertable User
Hi Zhou,

I've also worked on the problem for 1 days and now solved it by Luke's
reply.

The actually link command I found is:

g++ -g -fPIC "apache_log_load.o" -o apache_log_load \
-rdynamic \
-L/opt/hypertable/current/lib -L/usr/local/lib \
-lHypertable -lHyperComm -lHyperCommon -lHyperspace -lHyperTools -
ldb_cxx -lexpat -lHyperTools \
-lpthread \
-lboost_iostreams -lboost_program_options -lboost_filesystem -
lboost_thread -lboost_system \
-llog4cpp -lreadline -lncurses -lz -lsigar-amd64-linux -ldl -lncurses
\
-lsigar-amd64-linux -lcurses -lHyperDfsBroker \
-lHypertable

Please note:
1. there's two "-lHypertable"
2. extra libs referenced like db_cxx and expat

Wish you good luck. And thanks Luke for the hint!

Best,
> /usr/lib/gcc/x86_64-redhat-linux/4.4.2/../../../../include/c++/4.4.2/backwa rd/hash_map:59,
>                  from /opt/hypertable/current/include/Common/HashMap.h:24,
>                  from
> /opt/hypertable/current/include/AsyncComm/ApplicationQueue.h:34,
>                  from
> /opt/hypertable/current/include/Hypertable/Lib/Client.h:29,
>                  from
> /opt/hypertable/current/examples/apache_log/apache_log_load.cc:31:
> /usr/lib/gcc/x86_64-redhat-linux/4.4.2/../../../../include/c++/4.4.2/backwa rd/backward_warning.h:28:2:
> warning: #warning This file includes at least one deprecated or antiquated
> header which may be removed without further notice at a future date. Please
> use a non-deprecated interface with equivalent functionality instead. For a
> listing of replacement headers and interfaces, consult the file
> backward_warning.h. To disable this warning use -Wno-deprecated.
> Linking CXX executable apache_log_load
> /usr/bin/cmake -E cmake_link_script CMakeFiles/apache_log_load.dir/link.txt
> --verbose=1
> /usr/lib64/ccache/c++   -I/opt/hypertable/current/include/  -fPIC
> -L/opt/hypertable/current/lib
> CMakeFiles/apache_log_load.dir/apache_log_load.cc.o  -o apache_log_load
> -rdynamic -lHypertable
> CMakeFiles/apache_log_load.dir/apache_log_load.cc.o: In function `(anonymous
> namespace)::format_timestamp(tm)':
> apache_log_load.cc:(.text+0x1ec): undefined reference to
> `Hypertable::format(char const*, ...)'
> CMakeFiles/apache_log_load.dir/apache_log_load.cc.o: In function `(anonymous
> namespace)::report_error(Hypertable::Exception&)':
> apache_log_load.cc:(.text+0x235): undefined reference to
> `Hypertable::Error::get_text(int)'
> CMakeFiles/apache_log_load.dir/apache_log_load.cc.o: In function `(anonymous
> namespace)::handle_mutation_failure(boost::intrusive_ptr<Hypertable::TableM utator>&)':
> apache_log_load.cc:(.text+0x3af): undefined reference to
> `Hypertable::Error::get_text(int)'
> CMakeFiles/apache_log_load.dir/apache_log_load.cc.o: In function `main':
> apache_log_load.cc:(.text+0xbca): undefined reference to
> `Hypertable::operator<<(std::basic_ostream<char, std::char_traits<char> >&,
> Hypertable::Exception const&)'
> apache_log_load.cc:(.text+0xcc6): undefined reference to
> `Hypertable::operator<<(std::basic_ostream<char, std::char_traits<char> >&,
> Hypertable::Exception const&)'
> CMakeFiles/apache_log_load.dir/apache_log_load.cc.o:(.gcc_except_table+0x19 0):
> undefined reference to `typeinfo for Hypertable::Exception'
> /opt/hypertable/current/lib/libHypertable.a(ApacheLogParser.cc.o): In
> function
> `boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filter<boost: :iostreams::detail::zlib_decompressor_impl<std::allocator<char>>, std::allocator<char> >::impl>::dispose()':
>
> ApacheLogParser.cc:(.text._ZN5boost6detail17sp_counted_impl_pINS_9iostreams 16symmetric_filterINS2_6detail22zlib_decompressor_implISaIcEEES6_E4implEE7d isposeEv[boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filte r<boost::iostreams::detail::zlib_decompressor_impl<std::allocator<char>>, std::allocator<char> >::impl>::dispose()]+0x2d): undefined reference to
>
> `boost::iostreams::detail::zlib_base::reset(bool, bool)'
> ApacheLogParser.cc:(.text._ZN5boost6detail17sp_counted_impl_pINS_9iostreams 16symmetric_filterINS2_6detail22zlib_decompressor_implISaIcEEES6_E4implEE7d isposeEv[boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filte r<boost::iostreams::detail::zlib_decompressor_impl<std::allocator<char>>, std::allocator<char> >::impl>::dispose()]+0x35): undefined reference to
>
> `boost::iostreams::detail::zlib_base::~zlib_base()'
> ApacheLogParser.cc:(.text._ZN5boost6detail17sp_counted_impl_pINS_9iostreams 16symmetric_filterINS2_6detail22zlib_decompressor_implISaIcEEES6_E4implEE7d isposeEv[boost::detail::sp_counted_impl_p<boost::iostreams::symmetric_filte r<boost::iostreams::detail::zlib_decompressor_impl<std::allocator<char>>, std::allocator<char> >::impl>::dispose()]+0x66): undefined reference to
>
> `boost::iostreams::detail::zlib_base::~zlib_base()'
> /opt/hypertable/current/lib/libHypertable.a(ApacheLogParser.cc.o): In
> function `boost::iostreams::basic_gzip_decompressor<std::allocator<char>>::make_params(int)':
>
> ApacheLogParser.cc:(.text._ZN5boost9iostreams23basic_gzip_decompressorISaIc EE11make_paramsEi[boost::iostreams::basic_gzip_decompressor<std::allocator< char>>::make_params(int)]+0x49): undefined reference to
>
> `boost::iostreams::zlib::default_compression'
> ApacheLogParser.cc:(.text._ZN5boost9iostreams23basic_gzip_decompressorISaIc EE11make_paramsEi[boost::iostreams::basic_gzip_decompressor<std::allocator< char>>::make_params(int)]+0x6e): undefined reference to
>
> `boost::iostreams::zlib::deflated'
> ApacheLogParser.cc:(.text._ZN5boost9iostreams23basic_gzip_decompressorISaIc EE11make_paramsEi[boost::iostreams::basic_gzip_decompressor<std::allocator< char>>::make_params(int)]+0x77): undefined reference to
>
> `boost::iostreams::zlib::default_strategy'
> /opt/hypertable/current/lib/libHypertable.a(ApacheLogParser.cc.o): In
> function `void
> boost::iostreams::close<boost::iostreams::basic_gzip_decompressor<std::allo cator<char>>, boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> >
> >(boost::iostreams::basic_gzip_decompressor<std::allocator<char> >&,
>
> boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> >&,
> std::_Ios_Openmode)':
> ApacheLogParser.cc:(.text._ZN5boost9iostreams5closeINS0_23basic_gzip_decomp ressorISaIcEEENS0_6detail16linked_streambufIcSt11char_traitsIcEEEEEvRT_RT0_ St13_Ios_Openmode[void
> boost::iostreams::close<boost::iostreams::basic_gzip_decompressor<std::allo cator<char>>, boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> >
> > On Mon, Apr 26, 2010 at 11:41 AM, Zhuo Yin <zhuo...@gmail.com> wrote:
> > > Doug:
>
> > > Thanks for the command,
>
> > > I did the same thing as you did. The command output is the same. seems
> > the
> > > library has such functions.
>
> > > But I don't know why it cannot be linked. I changed the order of g++
> > command
> > > line but still get no luck, which really bothers me. Do you have any
> > > suggestion for this?
>
> > > Regards,
> > > Zhuo Yin (917)215-8740
> > > Gentoo Linux Fan - int (*(*(*pFile)())[10])();
>
> > >>>>> hypertable-us...@googlegroups.com<hypertable-user%2Bunsubscribe@ googlegroups.com>
> > .
> > >>>>> For more options, visit this group at
> > >>>>>http://groups.google.com/group/hypertable-user?hl=en.
>
> > >>>> --
> > >>>> You received this message because you are subscribed to the Google
> > >>>> Groups "Hypertable User" group.
> > >>>> To post to this group, send email to hyperta...@googlegroups.com
> > .
> > >>>> To unsubscribe from this group, send email to
> > >>>> hypertable-us...@googlegroups.com<hypertable-user%2Bunsubscribe@ googlegroups.com>
> > .
> > >>>> For more options, visit this group at
> > >>>>http://groups.google.com/group/hypertable-user?hl=en.
>
> > >>>> --
> > >>>> You received this message because you are subscribed to the Google
> > >>>> Groups "Hypertable User" group.
> > >>>> To post to this group, send email to hyperta...@googlegroups.com
> > .
> > >>>> To unsubscribe from this group, send email to
> > >>>> hypertable-us...@googlegroups.com<hypertable-user%2Bunsubscribe@ googlegroups.com>
> > .
> > >>>> For more options, visit this group at
> > >>>>http://groups.google.com/group/hypertable-user?hl=en.
>
> > >>> --
> > >>> You received this message because you are subscribed to the Google
> > Groups
> > >>> "Hypertable User" group.
> > >>> To post to this group, send email to hyperta...@googlegroups.com.
> > >>> To unsubscribe from this group, send email to
> > >>> hypertable-us...@googlegroups.com<hypertable-user%2Bunsubscribe@ googlegroups.com>
> > .
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/hypertable-user?hl=en.
>
> > >>> --
> > >>> You received this message because you are subscribed to the Google
> > Groups
> > >>> "Hypertable User" group.
> > >>> To post to this group, send email to hyperta...@googlegroups.com.
> > >>> To unsubscribe from this group, send email to
> > >>> hypertable-us...@googlegroups.com<hypertable-user%2Bunsubscribe@ googlegroups.com>
> > .
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/hypertable-user?hl=en.
>
> > >> --
> > >> You received this message because you are subscribed to the Google
> > Groups
> > >> "Hypertable User" group.
> > >> To post to this group, send email to hyperta...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> hypertable-us...@googlegroups.com<hypertable-user%2Bunsubscribe@ googlegroups.com>
> > .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/hypertable-user?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Hypertable User" group.
> > > To post to this group, send email to hyperta...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > hypertable-us...@googlegroups.com<hypertable-user%2Bunsubscribe@ googlegroups.com>
> > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/hypertable-user?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Hypertable User" group.
> > To post to this group, send email to hyperta...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > hypertable-us...@googlegroups.com<hypertable-user%2Bunsubscribe@ googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/hypertable-user?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Hypertable User" group.
> To post to this group, send email to hyperta...@googlegroups.com.
> To unsubscribe from this group, send email to hypertable-us...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/hypertable-user?hl=en.

Zhuo Yin

unread,
Apr 28, 2010, 1:10:35 AM4/28/10
to hyperta...@googlegroups.com
Kevin, Luke, Doug -

Thanks for patient explain.

But the two -lHypertable seems weired, any reason to use two -lHypertable?

and like Kevin said, miss any one of this will not working.

Thanks,
Zhuo Yin

Luke

unread,
Apr 28, 2010, 1:46:44 PM4/28/10
to hyperta...@googlegroups.com
On Tue, Apr 27, 2010 at 10:10 PM, Zhuo Yin <zhu...@gmail.com> wrote:
> Kevin, Luke, Doug -
>
> Thanks for patient explain.
>
> But the two -lHypertable seems weired, any reason to use two -lHypertable?

Because libHyperDfsBroker and libHypertable has a circular dependency
introduced by Sanjit's checkin on 4/1 for Issue 259. cmake takes care
of the link dependencies automatically. It works for static libs. But
dynamic libs now no longer builds in the new release.

There is a plan to refactor the libraries to remove the dependency, though.

__Luke

Sanjit Jhala

unread,
Apr 28, 2010, 2:11:18 PM4/28/10
to hyperta...@googlegroups.com
We can fix it by moving the FileSystem class into the Common library (and possibly move the Path class in Common/Filesystem.h to FileUtils or rename it to avoid confusion) .

-Sanjit

Loris Giovannini

unread,
May 4, 2010, 4:59:10 AM5/4/10
to hyperta...@googlegroups.com
Hi all
I have the same problem I want to compile a very easy example I have make a littel change to the /opt/hypertable/current/examples/apache_log/apache_log_load.cc:

My example is:
#include <Common/Compat.h>


#include <cstdio>



#include <Common/System.h>
#include <Common/Error.h>

#include <Hypertable/Lib/Client.h>
#include <Hypertable/Lib/KeySpec.h>

using namespace Hypertable;
using namespace std; 

namespace {

  const char *usage =
    "\n"
    "  usage: apache_log_query <row-prefix> [ <cf> ... ]\n"
    "\n"
    "  Queries the table 'LogDb' for all rows that start\n"
    "  with <row-prefix>.  If no column families are\n"
    "  specified, then all column families are returned.\n"
    "  Otherwise, just the column families specified by\n"
    "  the <cf> arguments are returned\n";
}


int main(int argc, char **argv) {
  ClientPtr client_ptr;
  TablePtr table_ptr;
  TableScannerPtr scanner_ptr;
  ScanSpecBuilder scan_spec_builder;
  Cell cell;
  String end_row;
 
  if (argc <= 1) {
    cout << usage << endl;
   return 0;
  }

  try {

    // Create Hypertable client object
    client_ptr = new Client();

    // Open the 'LogDb' table
    table_ptr = client_ptr->open_table("archive2");

     // setup row interval
    end_row = (String)argv[1];
    end_row.append(1, 0xff);  // next minimum row
    scan_spec_builder.add_row_interval((const char *)argv[1], true, end_row.c_str(), false);


    // setup scan_spec columns
   // for (int i=2; i<argc; i++)
    //  scan_spec_builder.add_column(argv[i]);

    // Create a scanner on the 'LogDb' table
    scanner_ptr = table_ptr->create_scanner(scan_spec_builder.get());

  }
  catch (Exception &e) {
    cerr << e << endl;
    return 1;
  }

  // Iterate through the cells returned by the scanner
  while (scanner_ptr->next(cell)) {
    printf("%s\t%s", cell.row_key, cell.column_family);
    if (*cell.column_qualifier)
      printf(":%s", cell.column_qualifier);
    printf("\t%s\n", std::string((const char *)cell.value, cell.value_len).c_str());
  }

  return 0;
}

for complile I use the follow command:

g++ -I/opt/hypertable/current/lib -I/opt/hypertable/current/include -L/usr/local/lib -L/usr/lib -lHyperCommon -lHypertable -lHyperComm -lHyperCommon -lHypertable -Wno-deprecated -c test.cc
The output of this command create a test.o file

g++ -o test test.o -L/opt/hypertable/current/lib -lHypertable -lHyperComm -lHyperCommon -lHyperTools -llog4cpp -lexpat -lboost_thread -lboost_iostreams -lboost_program_options -lboost_system -lsigar-x86-linux -lHyperspace -lz -lcurses
When I thorow the command above the output is:
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o): In function `(anonymous namespace)::cmd_load_data(Hypertable::Client*, unsigned int, boost::intrusive_ptr<Hypertable::ConnectionManager>&, boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, Hypertable::Hql::ParserState&, Hypertable::HqlInterpreter::Callback&)':
HqlInterpreter.cc:(.text+0x15bc): undefined reference to `Hypertable::DfsBroker::Client::Client(boost::intrusive_ptr<Hypertable::ConnectionManager>&, boost::intrusive_ptr<Hypertable::Properties>&)'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o): In function `(anonymous namespace)::cmd_dump_table(Hypertable::Client*, boost::intrusive_ptr<Hypertable::ConnectionManager>&, boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, Hypertable::Hql::ParserState&, Hypertable::HqlInterpreter::Callback&)':
HqlInterpreter.cc:(.text+0x3739): undefined reference to `Hypertable::DfsBroker::FileDevice::FileDevice(boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
HqlInterpreter.cc:(.text+0x376c): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
HqlInterpreter.cc:(.text+0x3a58): undefined reference to `Hypertable::DfsBroker::Client::Client(boost::intrusive_ptr<Hypertable::ConnectionManager>&, boost::intrusive_ptr<Hypertable::Properties>&)'
HqlInterpreter.cc:(.text+0x3ddb): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o): In function `(anonymous namespace)::cmd_select(Hypertable::Client*, boost::intrusive_ptr<Hypertable::ConnectionManager>&, boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, Hypertable::Hql::ParserState&, Hypertable::HqlInterpreter::Callback&)':
HqlInterpreter.cc:(.text+0x4c0b): undefined reference to `Hypertable::DfsBroker::FileDevice::FileDevice(boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
HqlInterpreter.cc:(.text+0x4c3e): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
HqlInterpreter.cc:(.text+0x4f9d): undefined reference to `Hypertable::DfsBroker::Client::Client(boost::intrusive_ptr<Hypertable::ConnectionManager>&, boost::intrusive_ptr<Hypertable::Properties>&)'
HqlInterpreter.cc:(.text+0x5398): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o): In function `Hypertable::DfsBroker::FileSink::~FileSink()':
HqlInterpreter.cc:(.text._ZN10Hypertable9DfsBroker8FileSinkD0Ev[Hypertable::DfsBroker::FileSink::~FileSink()]+0x17): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o): In function `Hypertable::DfsBroker::FileSink::~FileSink()':
HqlInterpreter.cc:(.text._ZN10Hypertable9DfsBroker8FileSinkD1Ev[Hypertable::DfsBroker::FileSink::~FileSink()]+0x14): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o): In function `boost::iostreams::detail::execute_traits<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::result_of<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > > ()()>::type>::result_type boost::iostreams::detail::execute_all<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSink> > > >(boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSink> > >)':
HqlInterpreter.cc:(.text._ZN5boost9iostreams6detail11execute_allINS1_22member_close_operationINS1_16linked_streambufIcSt11char_traitsIcEEEEES8_NS1_15reset_operationINS1_8optionalINS1_15concept_adapterIN10Hypertable9DfsBroker8FileSinkEEEEEEEEENS1_14execute_traitsIT_NS_9result_ofIFSJ_vEE4typeEE11result_typeESJ_T0_T1_[boost::iostreams::detail::execute_traits<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::result_of<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > > ()()>::type>::result_type boost::iostreams::detail::execute_all<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSink> > > >(boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSink> > >)]+0x40): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
HqlInterpreter.cc:(.text._ZN5boost9iostreams6detail11execute_allINS1_22member_close_operationINS1_16linked_streambufIcSt11char_traitsIcEEEEES8_NS1_15reset_operationINS1_8optionalINS1_15concept_adapterIN10Hypertable9DfsBroker8FileSinkEEEEEEEEENS1_14execute_traitsIT_NS_9result_ofIFSJ_vEE4typeEE11result_typeESJ_T0_T1_[boost::iostreams::detail::execute_traits<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::result_of<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > > ()()>::type>::result_type boost::iostreams::detail::execute_all<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSink> > > >(boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSink> > >)]+0xa0): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):HqlInterpreter.cc:(.text._ZN5boost9iostreams6detail18indirect_streambufIN10Hypertable9DfsBroker8FileSinkESt11char_traitsIcESaIcENS0_6outputEE4openERKS5_ii[boost::iostreams::detail::indirect_streambuf<Hypertable::DfsBroker::FileSink, std::char_traits<char>, std::allocator<char>, boost::iostreams::output>::open(Hypertable::DfsBroker::FileSink const&, int, int)]+0x56): more undefined references to `vtable for Hypertable::DfsBroker::FileDevice' follow
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker8FileSinkE[vtable for Hypertable::DfsBroker::FileSink]+0x10): undefined reference to `Hypertable::DfsBroker::FileDevice::open(boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker8FileSinkE[vtable for Hypertable::DfsBroker::FileSink]+0x14): undefined reference to `Hypertable::DfsBroker::FileDevice::is_open() const'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker8FileSinkE[vtable for Hypertable::DfsBroker::FileSink]+0x18): undefined reference to `Hypertable::DfsBroker::FileDevice::read(char*, unsigned int)'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker8FileSinkE[vtable for Hypertable::DfsBroker::FileSink]+0x1c): undefined reference to `Hypertable::DfsBroker::FileDevice::bytes_read()'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker8FileSinkE[vtable for Hypertable::DfsBroker::FileSink]+0x20): undefined reference to `Hypertable::DfsBroker::FileDevice::length()'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker8FileSinkE[vtable for Hypertable::DfsBroker::FileSink]+0x24): undefined reference to `Hypertable::DfsBroker::FileDevice::write(char const*, unsigned int)'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker8FileSinkE[vtable for Hypertable::DfsBroker::FileSink]+0x28): undefined reference to `Hypertable::DfsBroker::FileDevice::bytes_written()'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker8FileSinkE[vtable for Hypertable::DfsBroker::FileSink]+0x2c): undefined reference to `Hypertable::DfsBroker::FileDevice::close()'
/opt/hypertable/current/lib/libHypertable.a(HqlInterpreter.cc.o):(.rodata._ZTIN10Hypertable9DfsBroker8FileSinkE[typeinfo for Hypertable::DfsBroker::FileSink]+0x10): undefined reference to `typeinfo for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o): In function `Hypertable::LoadDataSourceFileDfs::init_src()':
LoadDataSourceFileDfs.cc:(.text+0xf8): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
LoadDataSourceFileDfs.cc:(.text+0x13f): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
LoadDataSourceFileDfs.cc:(.text+0x3c6): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
LoadDataSourceFileDfs.cc:(.text+0x42c): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o): In function `Hypertable::LoadDataSourceFileDfs::LoadDataSourceFileDfs(boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)':
LoadDataSourceFileDfs.cc:(.text+0x53f): undefined reference to `Hypertable::DfsBroker::FileDevice::FileDevice(boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o): In function `Hypertable::LoadDataSourceFileDfs::LoadDataSourceFileDfs(boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)':
LoadDataSourceFileDfs.cc:(.text+0x9d2): undefined reference to `Hypertable::DfsBroker::FileDevice::FileDevice(boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o): In function `Hypertable::DfsBroker::FileSource::~FileSource()':
LoadDataSourceFileDfs.cc:(.text._ZN10Hypertable9DfsBroker10FileSourceD1Ev[Hypertable::DfsBroker::FileSource::~FileSource()]+0x14): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o): In function `Hypertable::DfsBroker::FileSource::~FileSource()':
LoadDataSourceFileDfs.cc:(.text._ZN10Hypertable9DfsBroker10FileSourceD0Ev[Hypertable::DfsBroker::FileSource::~FileSource()]+0x17): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o): In function `boost::iostreams::detail::execute_traits<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::result_of<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > > ()()>::type>::result_type boost::iostreams::detail::execute_all<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSource> > > >(boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSource> > >)':
LoadDataSourceFileDfs.cc:(.text._ZN5boost9iostreams6detail11execute_allINS1_22member_close_operationINS1_16linked_streambufIcSt11char_traitsIcEEEEES8_NS1_15reset_operationINS1_8optionalINS1_15concept_adapterIN10Hypertable9DfsBroker10FileSourceEEEEEEEEENS1_14execute_traitsIT_NS_9result_ofIFSJ_vEE4typeEE11result_typeESJ_T0_T1_[boost::iostreams::detail::execute_traits<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::result_of<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > > ()()>::type>::result_type boost::iostreams::detail::execute_all<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSource> > > >(boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSource> > >)]+0x40): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
LoadDataSourceFileDfs.cc:(.text._ZN5boost9iostreams6detail11execute_allINS1_22member_close_operationINS1_16linked_streambufIcSt11char_traitsIcEEEEES8_NS1_15reset_operationINS1_8optionalINS1_15concept_adapterIN10Hypertable9DfsBroker10FileSourceEEEEEEEEENS1_14execute_traitsIT_NS_9result_ofIFSJ_vEE4typeEE11result_typeESJ_T0_T1_[boost::iostreams::detail::execute_traits<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::result_of<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > > ()()>::type>::result_type boost::iostreams::detail::execute_all<boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSource> > > >(boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::member_close_operation<boost::iostreams::detail::linked_streambuf<char, std::char_traits<char> > >, boost::iostreams::detail::reset_operation<boost::iostreams::detail::optional<boost::iostreams::detail::concept_adapter<Hypertable::DfsBroker::FileSource> > >)]+0xa0): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o): In function `boost::iostreams::detail::indirect_streambuf<Hypertable::DfsBroker::FileSource, std::char_traits<char>, std::allocator<char>, boost::iostreams::input>::open(Hypertable::DfsBroker::FileSource const&, int, int)':
LoadDataSourceFileDfs.cc:(.text._ZN5boost9iostreams6detail18indirect_streambufIN10Hypertable9DfsBroker10FileSourceESt11char_traitsIcESaIcENS0_5inputEE4openERKS5_ii[boost::iostreams::detail::indirect_streambuf<Hypertable::DfsBroker::FileSource, std::char_traits<char>, std::allocator<char>, boost::iostreams::input>::open(Hypertable::DfsBroker::FileSource const&, int, int)]+0x78): undefined reference to `vtable for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):LoadDataSourceFileDfs.cc:(.text._ZN5boost9iostreams6detail18indirect_streambufIN10Hypertable9DfsBroker10FileSourceESt11char_traitsIcESaIcENS0_5inputEE4openERKS5_ii[boost::iostreams::detail::indirect_streambuf<Hypertable::DfsBroker::FileSource, std::char_traits<char>, std::allocator<char>, boost::iostreams::input>::open(Hypertable::DfsBroker::FileSource const&, int, int)]+0xa6): more undefined references to `vtable for Hypertable::DfsBroker::FileDevice' follow
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTIN10Hypertable9DfsBroker10FileSourceE[typeinfo for Hypertable::DfsBroker::FileSource]+0x10): undefined reference to `typeinfo for Hypertable::DfsBroker::FileDevice'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker10FileSourceE[vtable for Hypertable::DfsBroker::FileSource]+0x10): undefined reference to `Hypertable::DfsBroker::FileDevice::open(boost::intrusive_ptr<Hypertable::DfsBroker::Client>&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker10FileSourceE[vtable for Hypertable::DfsBroker::FileSource]+0x14): undefined reference to `Hypertable::DfsBroker::FileDevice::is_open() const'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker10FileSourceE[vtable for Hypertable::DfsBroker::FileSource]+0x18): undefined reference to `Hypertable::DfsBroker::FileDevice::read(char*, unsigned int)'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker10FileSourceE[vtable for Hypertable::DfsBroker::FileSource]+0x1c): undefined reference to `Hypertable::DfsBroker::FileDevice::bytes_read()'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker10FileSourceE[vtable for Hypertable::DfsBroker::FileSource]+0x20): undefined reference to `Hypertable::DfsBroker::FileDevice::length()'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker10FileSourceE[vtable for Hypertable::DfsBroker::FileSource]+0x24): undefined reference to `Hypertable::DfsBroker::FileDevice::write(char const*, unsigned int)'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker10FileSourceE[vtable for Hypertable::DfsBroker::FileSource]+0x28): undefined reference to `Hypertable::DfsBroker::FileDevice::bytes_written()'
/opt/hypertable/current/lib/libHypertable.a(LoadDataSourceFileDfs.cc.o):(.rodata._ZTVN10Hypertable9DfsBroker10FileSourceE[vtable for Hypertable::DfsBroker::FileSource]+0x2c): undefined reference to `Hypertable::DfsBroker::FileDevice::close()'
/opt/hypertable/current/lib/libHyperCommon.a(Config.cc.o): In function `boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> boost::filesystem::current_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >()':
Config.cc:(.text._ZN5boost10filesystem12current_pathINS0_10basic_pathISsNS0_11path_traitsEEEEET_v[boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> boost::filesystem::current_path<boost::filesystem::basic_path<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::filesystem::path_traits> >()]+0x21): undefined reference to `boost::filesystem::detail::get_current_path_api(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/opt/hypertable/current/lib/libHyperspace.a(HsCommandInterpreter.cc.o): In function `Hyperspace::HsCommandInterpreter::HsCommandInterpreter(Hyperspace::Session*)':
HsCommandInterpreter.cc:(.text+0x3e): undefined reference to `Hypertable::CommandInterpreter::CommandInterpreter()'
/opt/hypertable/current/lib/libHyperspace.a(HsCommandInterpreter.cc.o): In function `Hyperspace::HsCommandInterpreter::HsCommandInterpreter(Hyperspace::Session*)':
HsCommandInterpreter.cc:(.text+0x6e): undefined reference to `Hypertable::CommandInterpreter::CommandInterpreter()'

collect2: ld returned 1 exit status

any suggestion?
I'm not an expert in cpp, I tried to change the MakeFile in the example folder, as written into README.TXT and the output is the same.

Loris


2010/4/28 Sanjit Jhala <sjh...@gmail.com>

Zhuo Yin

unread,
May 4, 2010, 9:51:18 AM5/4/10
to hyperta...@googlegroups.com
Try the command Kevin provided, there are two -lHypertable there

>> g++ -g -fPIC "apache_log_load.o" -o apache_log_load  \
>> -rdynamic \
>> -L/opt/hypertable/current/lib  -L/usr/local/lib \
>> -lHypertable -lHyperComm -lHyperCommon -lHyperspace  -lHyperTools -
>> ldb_cxx -lexpat -lHyperTools  \
>> -lpthread \
>> -lboost_iostreams -lboost_program_options -lboost_filesystem -
>> lboost_thread -lboost_system \
>> -llog4cpp -lreadline -lncurses -lz -lsigar-amd64-linux -ldl -lncurses
>> \
>> -lsigar-amd64-linux -lcurses -lHyperDfsBroker \
>> -lHypertable
Reply all
Reply to author
Forward
0 new messages