0

I am trying to compile Zeroc ICE demo program.

at the time of linking, i get multiple undefined reference errors.

/Clock.cpp:71: undefined reference to IceInternal::Outgoing::Outgoing(IceProxy::Ice::Object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Ice::OperationMode, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const*)'

I tried the following to diagnose the issue:

Change the order of lib reference in g++ command (source cpp then -l):

g++ -std=c++11 Clock.cpp -lpthread -lIce -lIceUtil  -lIceStorm

but no help.

Further, I tried to see if the referred lib files contain the reported symbols. I ran objdump -TC libIce.so to see:

00000000001f53d0 g    DF .text  000000000000141c  Base        IceInternal::Outgoing::Outgoing(IceProxy::Ice::Object*, std::string const&, Ice::OperationMode, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const*)

I use g++(GCC) 6.2.0.

Could anyone help please.

Sander De Dycker
  • 16,053
  • 1
  • 35
  • 40
rat6
  • 81
  • 9
  • I'm only guessing, but maybe you should put `-lIceStorm` before `-lIce`. – Markus Mayr Apr 27 '17 at 11:25
  • 1
    https://doc.zeroc.com/display/Ice36/Supported+Platforms+for+Ice+3.6.3#SupportedPlatformsforIce3.6.3-IceforC++ latest supported gcc is GCC 5.3, maybe you need to build ice from sources ? try to build with older gcc, if it works, then build for gcc 6.2 from sources – zapredelom Apr 27 '17 at 11:34
  • Are you using an Ice binary distribution and if so which one? – José Apr 27 '17 at 11:36
  • @MarkusMayr i tried your advice; did not help. – rat6 Apr 27 '17 at 11:48
  • @José i have installed Ice binary distribution 3.6.4. – rat6 Apr 27 '17 at 11:49
  • i think @zapredelom & Sander are pointing to a single thing. I would try to rebuild the Ice from source with gcc6 and post my findings here. Thank you. – rat6 Apr 27 '17 at 11:51
  • @rat6 : that, or you can rebuild your project with `-D_GLIBCXX_USE_CXX11_ABI=0` – Sander De Dycker Apr 27 '17 at 11:52
  • @SanderDeDycker that just worked !!! To be compatible with rest of the code, i would consider building Ice from the source with gcc6. – rat6 Apr 27 '17 at 11:56
  • @rat6 I would still recompile `Ice`, in particular, if you are going to use any other libraries as well. – Markus Mayr Apr 27 '17 at 11:57
  • more info : https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html – Sander De Dycker Apr 27 '17 at 11:58
  • @rat6 I guess you mean 3.6.3, we have not released 3.6.4 yet :) (I work for ZeroC) The easy is to use one of the supported platforms https://doc.zeroc.com/display/Ice36/Supported+Platforms+for+Ice+3.6.3 If you cannot you must rebuild from sources. See also https://doc.zeroc.com/display/Ice36/Using+the+Linux+Binary+Distributions#UsingtheLinuxBinaryDistributions-C++ you need to link with C++11 libs – José Apr 27 '17 at 12:14

0 Answers0