Using 0.6.1 version I get a strange "undefined reference" when building the tutorial/cpp. So I rebuilt 'thrift' from current SVN repo. Everything build fine, but I still get the same undefined reference error for "VERSION_1" that I list below. I welcome any hints/pointers. Perhaps my error is silly, but I can't figure this out.
Gautam On 6/13/2011 11:12 PM, Gautam Thaker wrote: > Hi : > > I am new to thrift. I did a "./configure --prefix=/home/gthaker/usr " > and then "make; make install". Things seemed to go ok, i have for > example the following libs installed: > > > fc15-32> ls -l /home/gthaker/usr/lib > total 10532 > -rw-r--r--. 1 root root 6654298 Jun 13 23:02 libthrift.a > -rwxr-xr-x. 1 root root 828 Jun 13 23:02 libthrift.la > lrwxrwxrwx. 1 root root 18 Jun 13 23:02 libthrift.so -> > libthrift.so.0.0.0 > lrwxrwxrwx. 1 root root 18 Jun 13 23:02 libthrift.so.0 -> > libthrift.so.0.0.0 > -rwxr-xr-x. 1 root root 3739842 Jun 13 23:02 libthrift.so.0.0.0 > -rw-r--r--. 1 root root 215738 Jun 13 23:02 libthriftz.a > -rwxr-xr-x. 1 root root 835 Jun 13 23:02 libthriftz.la > lrwxrwxrwx. 1 root root 19 Jun 13 23:02 libthriftz.so -> > libthriftz.so.0.0.0 > lrwxrwxrwx. 1 root root 19 Jun 13 23:02 libthriftz.so.0 -> > libthriftz.so.0.0.0 > -rwxr-xr-x. 1 root root 155346 Jun 13 23:02 libthriftz.so.0.0.0 > drwxrwxr-x. 2 gthaker gthaker 4096 Jun 13 23:02 pkgconfig > > > I then tried to make the 'tutorial' CPP program. I get the following > undefined references. Any hints welcome. Thanks and sorry for the newbie > question. I am on fedora 15 system, using gcc/g++ 4.6.0, thrift 0.6.1 > > Gautam > > > fc15-32> make > g++ -o CppServer -I/home/gthaker/usr/include/thrift -I/usr/include/boost > -I../gen-cpp -L/home/gthaker/usr/lib -lthrift CppServer.cpp > ../gen-cpp/SharedService.cpp ../gen-cpp/shared_types.cpp > ../gen-cpp/tutorial_types.cpp ../gen-cpp/Calculator.cpp > /tmp/ccweqJZD.o: In function > `apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::writeMessageBegin(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&, > apache::thrift::protocol::TMessageType, int)': > CppServer.cpp:(.text._ZN6apache6thrift8protocol16TBinaryProtocolTINS0_9transport10TTransportEE17writeMessageBeginERKSsNS1_12TMessageTypeEi[apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::writeMessageBegin(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&, > apache::thrift::protocol::TMessageType, int)]+0x15): undefined reference > to > `apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::VERSION_1' > /tmp/ccweqJZD.o: In function > `apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::readMessageBegin(std::basic_string<char, > std::char_traits<char>, std::allocator<char> >&, > apache::thrift::protocol::TMessageType&, int&)': > CppServer.cpp:(.text._ZN6apache6thrift8protocol16TBinaryProtocolTINS0_9transport10TTransportEE16readMessageBeginERSsRNS1_12TMessageTypeERi[apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::readMessageBegin(std::basic_string<char, > std::char_traits<char>, std::allocator<char> >&, > apache::thrift::protocol::TMessageType&, int&)]+0x33): undefined > reference to > `apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::VERSION_MASK' > CppServer.cpp:(.text._ZN6apache6thrift8protocol16TBinaryProtocolTINS0_9transport10TTransportEE16readMessageBeginERSsRNS1_12TMessageTypeERi[apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::readMessageBegin(std::basic_string<char, > std::char_traits<char>, std::allocator<char> >&, > apache::thrift::protocol::TMessageType&, int&)]+0x3d): undefined > reference to > `apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::VERSION_1' > collect2: ld returned 1 exit status > make: *** [server] Error 1 > >
