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

How to link Linux C++ Ice


As far as I know, I've successfully built the Ice in my Linux environment, I want to verify the same thing I did earlier this week in Windows C# .NET, except this time in C++ Linux environment, because that's what we'll be running in development more frequently into production.

However, I am receiving many linker errors undefined references to Ice::Application::main(int, char**, char const*).

This tells me that somehow I am not linking correctly against the SO's,,, and so on. Or possibly I need to rebuild Ice with correct SO output for our build environment.

From what I know about our build system as well, the default tendency is to prefer dynamic linkage I think. I'll rebuild from Ice source if I need to obviously.


  • Unless possibly it is build correctly in and of itself, but is a binary incompatible issue making its way into our build system.
  • xdm
    xdm La Coruña, Spain

    You can look at Ice c++ demos for examples. Basically you need to link with Ice and IceUtil dynamic libraries, the link command will look something like:
    c++ -Wl,--enable-new-dtags -Wl,-rpath,/opt/Ice-3.4/lib -rdynamic  -Wall -D_REENTRANT -fPIC \
    -g  -L/opt/Ice-3.4/lib  -o server Hello.o HelloI.o Server.o  -lIce -lIceUtil -lpthread -lrt