[zeromq-dev] zmqpp doesn't build on Mac OS X?

Thomas Rodgers rodgert at twrodgers.com
Sat May 17 18:14:13 CEST 2014


-rdynamic on GCC instructs the compiler to add symbols it normally wouldn't
add to the resulting .so.  On OSX, the g++ you are most likely using is the
Apple front end to Clang supplied with XCode and NOT g++.  -soname is used
to mark your library's compatibility e.g. if you link against libzmqpp.so.3
and later deploy libzmqpp.so.3.1 you app would still be able to link
against the 3.1 version.  Clang on OSX doesn't AFAIK support -rdynamic or
-soname (for one thing they are dylibs no so's) options as such.

I haven't tried compiling the project in question, but most likely to use
the makefile AS IS you will need to get a real (ie. not part of XCode) GCC
installed.

You can follow these instructions to build it -
http://solarianprogrammer.com/2013/06/11/compiling-gcc-mac-os-x/

It also looks like Homebrew has a formula for GCC as well.


On Mon, May 12, 2014 at 3:00 PM, Ivan Figueredo <synctrader at gmail.com>wrote:

> Mac OS X Lion. gcc4.8.
>
>
> zmqpp is giving me errors under Mac OS X, gcc4.8,  g++: error:
> unrecognized command line option '-rdynamic':
>
> git clone https://github.com/zeromq/zmqpp.git
> Cloning into 'zmqpp'...
> remote: Reusing existing pack: 900, done.
> remote: Total 900 (delta 0), reused 0 (delta 0)
> Receiving objects: 100% (900/900), 285.07 KiB | 0 bytes/s, done.
> Resolving deltas: 100% (480/480), done.
> Checking connectivity... done.
> unknown28cfe9012d87:Downloads ivanfigueredo$ cd zmqpp/
> unknown28cfe9012d87:zmqpp ivanfigueredo$ make
> mkdir -p build/max-g++/obj/zmqpp/
> g++   -MMD -std=c++0x -pipe -Wall -fPIC -DBUILD_ENV=max
> -DBUILD_VERSION='"3.2.0"' -DBUILD_VERSION_MAJOR=3 -DBUILD_VERSION_MINOR=2
> -DBUILD_VERSION_REVISION=0 -DBUILD_DATESTAMP='"2014-05-12 13:10"'
> -DBUILD_LIBRARY_NAME='"zmqpp"' -DBUILD_CLIENT_NAME='"zmqpp"' -I./src -O3
> -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNDEBUG
> -c -o build/max-g++/obj/zmqpp/context.o src/zmqpp/context.cpp
> mkdir -p build/max-g++/obj/zmqpp/
> g++   -MMD -std=c++0x -pipe -Wall -fPIC -DBUILD_ENV=max
> -DBUILD_VERSION='"3.2.0"' -DBUILD_VERSION_MAJOR=3 -DBUILD_VERSION_MINOR=2
> -DBUILD_VERSION_REVISION=0 -DBUILD_DATESTAMP='"2014-05-12 13:10"'
> -DBUILD_LIBRARY_NAME='"zmqpp"' -DBUILD_CLIENT_NAME='"zmqpp"' -I./src -O3
> -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNDEBUG
> -c -o build/max-g++/obj/zmqpp/frame.o src/zmqpp/frame.cpp
> mkdir -p build/max-g++/obj/zmqpp/
> g++   -MMD -std=c++0x -pipe -Wall -fPIC -DBUILD_ENV=max
> -DBUILD_VERSION='"3.2.0"' -DBUILD_VERSION_MAJOR=3 -DBUILD_VERSION_MINOR=2
> -DBUILD_VERSION_REVISION=0 -DBUILD_DATESTAMP='"2014-05-12 13:10"'
> -DBUILD_LIBRARY_NAME='"zmqpp"' -DBUILD_CLIENT_NAME='"zmqpp"' -I./src -O3
> -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNDEBUG
> -c -o build/max-g++/obj/zmqpp/message.o src/zmqpp/message.cpp
> mkdir -p build/max-g++/obj/zmqpp/
> g++   -MMD -std=c++0x -pipe -Wall -fPIC -DBUILD_ENV=max
> -DBUILD_VERSION='"3.2.0"' -DBUILD_VERSION_MAJOR=3 -DBUILD_VERSION_MINOR=2
> -DBUILD_VERSION_REVISION=0 -DBUILD_DATESTAMP='"2014-05-12 13:10"'
> -DBUILD_LIBRARY_NAME='"zmqpp"' -DBUILD_CLIENT_NAME='"zmqpp"' -I./src -O3
> -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNDEBUG
> -c -o build/max-g++/obj/zmqpp/poller.o src/zmqpp/poller.cpp
> mkdir -p build/max-g++/obj/zmqpp/
> g++   -MMD -std=c++0x -pipe -Wall -fPIC -DBUILD_ENV=max
> -DBUILD_VERSION='"3.2.0"' -DBUILD_VERSION_MAJOR=3 -DBUILD_VERSION_MINOR=2
> -DBUILD_VERSION_REVISION=0 -DBUILD_DATESTAMP='"2014-05-12 13:10"'
> -DBUILD_LIBRARY_NAME='"zmqpp"' -DBUILD_CLIENT_NAME='"zmqpp"' -I./src -O3
> -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNDEBUG
> -c -o build/max-g++/obj/zmqpp/socket.o src/zmqpp/socket.cpp
> mkdir -p build/max-g++/obj/zmqpp/
> g++   -MMD -std=c++0x -pipe -Wall -fPIC -DBUILD_ENV=max
> -DBUILD_VERSION='"3.2.0"' -DBUILD_VERSION_MAJOR=3 -DBUILD_VERSION_MINOR=2
> -DBUILD_VERSION_REVISION=0 -DBUILD_DATESTAMP='"2014-05-12 13:10"'
> -DBUILD_LIBRARY_NAME='"zmqpp"' -DBUILD_CLIENT_NAME='"zmqpp"' -I./src -O3
> -funroll-loops -ffast-math -finline-functions -fomit-frame-pointer -DNDEBUG
> -c -o build/max-g++/obj/zmqpp/zmqpp.o src/zmqpp/zmqpp.cpp
> g++  -shared -rdynamic -Wl,-soname -Wl,libzmqpp.so.3 -o
> ./build/max-g++/libzmqpp.so.3 build/max-g++/obj/zmqpp/context.o
> build/max-g++/obj/zmqpp/frame.o build/max-g++/obj/zmqpp/message.o
> build/max-g++/obj/zmqpp/poller.o build/max-g++/obj/zmqpp/socket.o
> build/max-g++/obj/zmqpp/zmqpp.o  -lzmq
> g++: error: unrecognized command line option '-rdynamic'
> make: *** [libzmqpp.so] Error 1
>
>
>
> If I remove the -rdynamic line from the Makefile, I get this error:
>
>
>
> unknown28cfe9012d87:zmqpp ivanfigueredo$ make
> g++  -shared -soname -Wl,libzmqpp.so.3 -o ./build/max-g++/libzmqpp.so.3
> build/max-g++/obj/zmqpp/context.o build/max-g++/obj/zmqpp/frame.o
> build/max-g++/obj/zmqpp/message.o build/max-g++/obj/zmqpp/poller.o
> build/max-g++/obj/zmqpp/socket.o build/max-g++/obj/zmqpp/zmqpp.o  -lzmq
> g++: error: unrecognized command line option '-soname'
> make: *** [libzmqpp.so] Error 1
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140517/a552f464/attachment.htm>


More information about the zeromq-dev mailing list