Archived

This forum has been archived. Please start a new discussion on GitHub.

MacOS version wants to be in /opt

I just downloaded Ice to my Powerbook to try and test a few things remotely, and I've found that it seems to want to be installed in /opt.

The instructions say to install it in $ICE_HOME, which I defined as /usr/local/Ice-3.0.1. However, when I try and build and link against the libraries, I get these errors:

/usr/bin/ld: warning can't open dynamic library: /opt/Ice-3.0.1/lib/libIceUtil.30.dylib referenced from: /usr/local/Ice-3.0.1/lib/libIce.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
/usr/bin/ld: Undefined symbols:
_main
IceUtil::Exception::Exception()
IceUtil::Exception::~Exception()
IceUtil::SimpleShared::SimpleShared()
...

It looks like maybe the paths were hard coded into the libraries when they were built (rpath?)

Comments

  • This seems to clear up if I explicitly add more Ice libraries to the linker command. I guess it just isn't able to find them on its own (they are in DYLD_LIBRARY_PATH).
  • benoit
    benoit Rennes, France
    Hi,

    Yes, most of the time, you must link with the IceUtil library since your application most likely always reference symbols from it (for synchronization primitives, etc).

    The warning from the linker is misleading, it only shows up when the linker can't resolve symbols to link your application. I suppose the linker figures out that the IceUtil symbols that your application needs are also used by the Ice library and therefore tries to look for them in the IceUtil library which is supposed to be installed in /opt/Ice-3.0.1/lib... (note also that the linker doesn't use DYLD_LIBRARY_PATH to search for libraries).

    Anyway, the correct thing to do is to link with the IceUtil library :).

    As an aside, the Ice binary distribution was built with /opt/Ice-3.0.1 as the default install directory so that you don't have to set DYLD_LIBRARY_PATH at runtime if you install Ice in /opt/Ice-3.0.1. You can change this install directory with the Apple "install_name_tool" command line tool if you install Ice in another directory. Of course, you can also add the Ice lib directory to DYLD_LIBRARY_PATH.

    Cheers,
    Benoit.
  • Quick question then...

    Do you know if the Ice 3.1 release for OSX will be done with the gcc 4 tools or the gcc 3 tools?
  • benoit
    benoit Rennes, France
    Hi,

    Ice 3.1.0 will be built with GCC 4.0.1 on Mac OS X 10.4.

    Cheers,
    Benoit.