C++ linker error in Apache Thrift tutorial - undefined symbols

非 Y 不嫁゛ 提交于 2019-12-02 03:45:17

I ran into something similar on OSX Mavericks (I believe), this was a while back. Since you're using clang as well I take it you might be on OSX too?

Anyways, what I ended up doing was compiling on the C++11 standard and using for the stdlib libc++ as opposed to libstdc++. Current versions of clang deal well with both.

So your compile lines would probably end up looking something like this:

g++ -std=c++11 -stdlib=libc++ -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -Wall -I/usr/local/include/thrift Foo.cpp Foo_server.cpp foo_constants.cpp foo_types.cpp -L/usr/local/lib -lthrift -o foo

I also vaguely recall I had to resort to c++0x on linux and gcc, but these are subject to compiler/version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!