Tuesday, August 27, 2013

Clang, libc++ and ABI

I tried compiling GDCM with clang++ -stdlib=libc++, and here is what I get:

Linking CXX executable ../../bin/gdcminfo CMakeFiles/gdcminfo.dir/gdcminfo.cxx.o: In function `getInfoDate(Dict*, char const*)': /home/mathieu/Perso/gdcm/Applications/Cxx/gdcminfo.cxx:195: undefined reference to `Dict::lookup(char*, Object*, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >*)' CMakeFiles/gdcminfo.dir/gdcminfo.cxx.o: In function `getInfoString(Dict*, char const*, UnicodeMap*)': /home/mathieu/Perso/gdcm/Applications/Cxx/gdcminfo.cxx:257: undefined reference to `Dict::lookup(char*, Object*, std::__1::set<int, std::__1::less<int>, std::__1::allocator<int> >*)' clang: error: linker command failed with exit code 1 (use -v to see invocation)
However:

$ nm -D /usr/lib/x86_64-linux-gnu/libpoppler.so | grep lookup | c++filt| grep \ Dict::lookup\( 00000000000c1870 T Dict::lookup(char*, Object*, std::set<int, std::less<int>, std::allocator<int> >*)