Reputation: 4251
I previously compiled a simple command line program that made use of Poco C++ (which I love, by the way). The program ran perfectly for several months.
A few things must have changed on my computer, because now when I run the program, I receive the following error.
dyld: Symbol not found: __ZN4Poco4Util11Application12handleOptionERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_
Referenced from: /Users/me/bin/sqlmerge
Expected in: /usr/local/opt/poco/lib/libPocoUtil.16.dylib
in /Users/me/bin/sqlmerge
Can someone tell me why this is occurring? I compiled with Poco 1.4.6 and ran with Poco 1.4.6, even though for some reason Poco was missing from my computer and I had to reinstall with brew install poco
(I'm obviously running this on a Mac).
EDIT: I'm not sure of the cause, but reinstalling with the --c++11
option turned on fixes the issue. E.g.:
brew install poco --c++11
Perhaps the C++ name mangling slightly changes from older versions of the C++ standard to C++11?
Upvotes: 3
Views: 807
Reputation: 4934
C++ has no Application Binary Interface. This leads to lots of headaches, including forcing people to recompile if they upgrade compiler versions. Same compiler, different version, different name mangling. This is why most libraries have a C interface..for historical reasons, the C interface has stable name mangling on all known platforms.
http://morpher.com/documentation/articles/abi/ C++ ABI issues list
Herb Sutter has proposed a Stable Platform ABI for C++. So help might be on the way :-)
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4028.pdf
Upvotes: 1