|
From: Alex W. <ale...@gm...> - 2009-01-12 21:18:26
|
I posted this question to the Help forum, but I think the mailing list was
probably the correct location to send this question. I apologize if this
qualifies as a double posting.
I have Thrift and Scribe built and have passed messages successfully using
the example code included in these projects, like the Python scribe_cat file
under /scribe-2.0/examples. I am attempting to build my own Scribe C++
client, but I get a hundred different errors when I compile. I am grateful
for any help offered.
I'm on Ubuntu 8.04
I've tried compiling using g++ 4.2.4 and g++ 3.4
I'm using Boost 1.37
I'm using Thrift 20080411-r733188
I'm using Scribe 2.0 Scribe version 2.0 Last Update: Oct 29 2008
Here is a snapshot of the first few errors:
g++ -o CppClient -I/usr/local/include/thrift -I/usr/local/include/boost-1_37
-I/usr/local/include/thrift/fb303 -Igen-cpp -L/usr/local/lib -lthrift
CppClient.cpp gen-cpp/scribe.cpp
/tmp/ccRkmGTP.o: In function
`scribe::thrift::scribeProcessor::process_fn(facebook::thrift::protocol::TProtocol*,
facebook::thrift::protocol::TProtocol*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&, int)':
scribe.cpp:(.text+0x14d): undefined reference to
`facebook::fb303::FacebookServiceProcessor::process_fn(facebook::thrift::protocol::TProtocol*,
facebook::thrift::protocol::TProtocol*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&, int)'
/tmp/ccRkmGTP.o: In function
`scribe::thrift::scribe_Log_pargs::write(facebook::thrift::protocol::TProtocol*)
const':
scribe.cpp:(.text+0xcac): undefined reference to
`scribe::thrift::LogEntry::write(facebook::thrift::protocol::TProtocol*)
const'
/tmp/ccRkmGTP.o: In function
`scribe::thrift::scribe_Log_args::write(facebook::thrift::protocol::TProtocol*)
const':
scribe.cpp:(.text+0x1014): undefined reference to
`scribe::thrift::LogEntry::write(facebook::thrift::protocol::TProtocol*)
const'
/tmp/ccRkmGTP.o: In function
`scribe::thrift::scribe_Log_args::read(facebook::thrift::protocol::TProtocol*)':
scribe.cpp:(.text+0x11d9): undefined reference to
`scribe::thrift::LogEntry::read(facebook::thrift::protocol::TProtocol*)'
/tmp/ccRkmGTP.o: In function
`facebook::fb303::FacebookServiceClient::~FacebookServiceClient()':
My CppClient.cpp looks like this:
-------------------------------------------
#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <protocol/TBinaryProtocol.h>
#include <transport/TSocket.h>
#include <transport/TTransportUtils.h>
#include "gen-cpp/scribe.h"
using namespace std;
using namespace facebook::thrift;
using namespace facebook::thrift::protocol;
using namespace facebook::thrift::transport;
using namespace boost;
int main(int argc, char** argv) {
shared_ptr<TTransport> socket(new TSocket("localhost", 9090));
shared_ptr<TTransport> transport(new TBufferedTransport(socket));
shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
return 0;
}
-------------------------------------------
My gen-cpp/ directory contains the generated scribe files from
scribe-2.0/if/scribe.thrift
My Makefile looks like this:
------------------------------------------------
BOOST_DIR = /usr/local/include/boost-1_37
THRIFT_DIR = /usr/local/include/thrift
LIB_DIR = /usr/local/lib
SCRIBE_INC = /usr/local/include/thrift/fb303
GEN_SRC = gen-cpp/scribe.cpp
default: client
client: CppClient.cpp
g++ -o CppClient -I${THRIFT_DIR} -I${BOOST_DIR} -I${SCRIBE_INC} -Igen-cpp
-L${LIB_DIR} -lthrift CppClient.cpp ${GEN_SRC}
Again, any suggestions or debugging pointers would be greatly appreciated.
--Alex
|
|
From: Alex W. <ale...@gm...> - 2009-01-13 15:48:26
|
I figured out the problem. I had built the Thrift and Scribe libraries as static libraries, as is the default in the configure file, however my Makefile was trying to link dynamically (I was not using the -static flag, or -Wl,-Bstatic). I preferred to link dynamically, so I reconfigured the Thrift and Scribe libraries with the --disable-static flag, remade the libraries, copied them to my /usr/local/lib directory, and then my Makefile compiled my code without errors. I hope this helps someone else. --Alex |
|
From: <dl...@so...> - 2009-02-26 18:06:37
|
I have some Windows boxes that I would want to participate. Any docs or experience with building on Windows?Or should I plan on Cygwin or other Window/Linux tools? |
|
From: Anthony G. <an...@fa...> - 2009-02-27 03:45:15
|
I have not yet attempted to build Scribe on Windows. Currently Scribe uses the Boost Filesystem library to peform platform independent file operations (although I posted a discussion in the Forums about whether we should remove this dependency and just rely on people using Cygwin if they need to) . However, Scribe is dependent on Thrift(It uses thrift/lib/cpp as well as runs generated Thrift c++ code). So you would also need to be able to Build Thrift's cpp libraries on Windows. Based on the following link, it doesn't sound like you would be able to do so. But please let me know if you find a way to build on win32. Thanks, Anthony http://wiki.apache.org/thrift/ThriftInstallationWin32?highlight=%28win32%29 On 2/26/09 9:34 AM, "dl...@so..." <dl...@so...> wrote: I have some Windows boxes that I would want to participate. Any docs or experience with building on Windows?Or should I plan on Cygwin or other Window/Linux tools? ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Scribeserver-users mailing list Scr...@li... https://lists.sourceforge.net/lists/listinfo/scribeserver-users |