0

I've compiled a command-line tool against some C++ dynamic libraries using GCC 4.7 on Mac OS X 10.8. On the development system, the compiler was installed by MacPorts into /opt/local and the libraries reside in /usr/local/lib. The dynamic libraries are compiled from source alongside the program. (But they're built by cmake and I don't want to mess with that system.)

When I try to run it on another machine by putting the necessary dylibs into the executable's directory and DYLD_LIBRARY_PATH, it complains about an undefined symbol in the C++ standard library. It appears to be trying to load the older, builtin GNU standard library from /usr/lib/libstdc++.6.dylib.

How can I force the system to load the desired libstdc++?

Potatoswatter
  • 134,909
  • 25
  • 265
  • 421
  • You mean `/opt/local/lib` don't you? This is world of pain, if it's anything like CentOS! Can I ask why you don't use Apple Clang 4 and libc++.dylib? – trojanfoe Jan 03 '13 at 07:55
  • @trojanfoe GCC's libraries are in `/opt/local/lib`, the third-party library built from source installs into `/usr/local/lib`. Didn't use Clang because the application is portable to Linux; Macs are only used for development. (It installs onto Linux just fine, but I want to the binary with another developer, who only needs to use it, not build it.) Also, the `cmake` system is hardcoded to GNU AFAICT and the 3rd-party library isn't tested with Clang. – Potatoswatter Jan 03 '13 at 08:11
  • I think you are looking at the linker `rpath` stuff in order to tell the library where to look for dependencies. It's horrible and no way to start the new year... – trojanfoe Jan 03 '13 at 08:13

0 Answers0