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:
*.pro:
win32 {
   CONFIG(debug, debug|release):     LIBS += "C:/Ice-3.5.0/lib/iced.lib" \
                                             "C:/Ice-3.5.0/lib/iceutild.lib"
   else:
   CONFIG(release, debug|release):   LIBS += "C:/Ice-3.5.0/lib/ice.lib" \
                                             "C:/Ice-3.5.0/lib/iceutil.lib"
}
*.pro:
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
*.h:
#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?

Regards,
Aleksey Blokhin

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

Comments

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

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

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

    Cheers,
    Benoit.
  • 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.