Question

I am trying to build zeromq on OS X so that it is linked with libstdc++, since we have module which can't be rebuild against libc++. No matter what I do libzmq is always linked with libc++:

otool -L src/.libs/libzmq.3.dylib
src/.libs/libzmq.3.dylib:
    /usr/local/lib/libzmq.3.dylib (compatibility version 4.0.0, current version 4.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)

I currently tried:

../configure --srcdir=.. CC=gcc CXX=g++ CXXFLAGS="-stdlib=libstdc++" LDFLAGS="-v -L/usr/local/lib/ -stdlib=libstdc++" LIBS="-stdlib=libstdc++"

I would be very thankful for any suggestions.

Was it helpful?

Solution

OK, I finally got it working. Just force clang (XCode 5) to produce Mac OS X 10.6 compatible executables using this configuration line:

./configure --with-gnu-ld LDFLAGS="-lstdc++ -stdlib=libstdc++ -mmacosx-version-min=10.6" CXXFLAGS="-stdlib=libstdc++ -mmacosx-version-min=10.6"

This made the helloworld server and client work.

Here is the output from the otool call:

$ otool -L /usr/local/lib/libzmq.dylib
/usr/local/lib/libzmq.dylib:
/usr/local/lib/libzmq.4.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

P.S.: ZeroMQ 4.x build worked fine as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top