linking with clang++ on OS X generates lots of symbol not found errors

Solution 1:

I suspect this issue is because of the two C++ runtime libraries available under OS X. Use the following to link the dynamic library:

clang++ -stdlib=libc++ -o Analysis.dylib -shared DataFile.o CR39DataFile.o

(the -stdlib=libc++ being the key difference). I think the default C++ runtime is the GNU implementation which is confusing the linker as you compiled with the libc++ implementation.

Solution 2:

As a side note, faced with the same error message, I discovered I needed to use gcc -lstdc++ -lLibraryName ... (the stdc++ part being needed).

See also https://github.com/JonathanSalwan/Triton/issues/243