Home Help Center

Unresolved external symbol error at linking

renzorenzo Member Aleksey BlokhinOrganization: JSC "SRI Vector"Project: Remote host monitoring system
Hi, I need your help.

I have a very large Qt project for hosts' system monitoring, singnal processing of server hardware and etc. Now I want to refuse use of SNMP and FTP and replace it by ICE.
There are no problem to use ICE with Microsoft Visual Studio + Your AddIn. But not everything is so good with Qt (Microsoft Visual Studio (x86) compiler, not minGW).
I can't compile and link small ICE project (hello world) because of unresolved external symbol error at linking like this:
moc_iceclient.obj:-1: error: LNK2001: unresolved external symbol ""public: virtual __thiscall IClient::IceClient::~IceClient(void)" ([email protected]@@[email protected])"
iceclient.obj:-1: error: LNK2019: unresolved external symbol reference "class IceProxy::Ice::Object * __cdecl IceProxy::Server::upCast(class IceProxy::Server::AbstractServer *)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) &#1074; &#1092;&#1091;&#1085;&#1082;&#1094;&#1080;&#1080; "public: __thiscall IceInternal::ProxyHandle<class IceProxy::Server::AbstractServer>::ProxyHandle<class IceProxy::Server::AbstractServer>(class IceProxy::Server::AbstractServer *)" ([email protected]@[email protected]@@@[email protected]@[email protected]@[email protected]@@@Z)
iceclient.obj:-1: error: LNK2001: unresolved external symbol ""private: virtual class IceInternal::Handle<class IceDelegateD::Ice::Object> __thiscall IceProxy::Server::AbstractServer::__createDelegateD(void)" ([email protected]@[email protected]@@[email protected]@[email protected]@@@[email protected]@XZ)"
and etc...
I include ice.lib and iceutil.lib different ways:
win32 {
   CONFIG(debug, debug|release):     LIBS += "C:/Ice-3.5.0/lib/iced.lib" \
   CONFIG(release, debug|release):   LIBS += "C:/Ice-3.5.0/lib/ice.lib" \
win32:CONFIG(release, debug|release): LIBS *= -LC:/Ice-3.5.0/lib/ -lice -liceutil
else:win32:CONFIG(debug, debug|release): LIBS *= -LC:/Ice-3.5.0/lib/ -liced -liceutild
#pragma comment (lib,"C:/Ice-3.5.0/lib/iced.lib")
#pragma comment (lib,"C:/Ice-3.5.0/lib/iceutild.lib")
But unresolved symbol errors remain...

What can I do to proper linking ice libraries?

Aleksey Blokhin

P.S: And sorry for my bad English, it's not my native language


  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    The linker errors point to missing symbols which aren't symbols from the Ice library:
    IceProxy::Server::upCast(class IceProxy::Server::AbstractServer *)

    Did you perhaps simply forget to add the object(s) for the code generated by the Slice compiler?

  • renzorenzo Member Aleksey BlokhinOrganization: JSC "SRI Vector"Project: Remote host monitoring system
    OMG! Really! Now it works! So much sleepless nights because of it... I just included slice-generated file by #include "abstractserver.h", while it was at the subdir and wasn't found (it's a mystery for me why it wasn't error that file just wasn't found).

    Benoit, thanks a lot for ur help!
Sign In or Register to comment.