You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by Apache Wiki <wi...@apache.org> on 2011/09/07 18:53:32 UTC
[Thrift Wiki] Trivial Update of "ThriftUsageC++" by MarcoMatarazzo
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Thrift Wiki" for change notification.
The "ThriftUsageC++" page has been changed by MarcoMatarazzo:
http://wiki.apache.org/thrift/ThriftUsageC%2B%2B?action=diff&rev1=30&rev2=31
Comment:
linking flag moved to the end of linking command, to avoid errors.
g++ -Wall -I/usr/local/include/thrift -c your_thrift_file_types.cpp -o types.o
}}}
=== Linking ===
- You need to point your linker to the thrift library. (Linker flag: {{{ -lthrift }}} or {{{ -l/usr/local/lib/libthrift.so }}}
+ You need to point your linker to the thrift library. (Linker flag: {{{ -lthrift }}} or {{{ -l/usr/local/lib/libthrift.so }}})
{{{
- g++ -L/usr/local/lib -lthrift *.o -o Something_server
+ g++ -L/usr/local/lib *.o -o Something_server -lthrift
}}}
== Writing the client code ==
{{{thrift}}} generates a client interface, but you have to hook it up a bit on your own.
@@ -154, +154 @@
}}}
=== Linking ===
{{{
- g++ -L/usr/local/lib -lthrift client.o Something.o constants.o types.o -o Something_client
+ g++ -L/usr/local/lib client.o Something.o constants.o types.o -o Something_client -lthrift
}}}
== Compiling/Building everything with Makefile ==