Archived

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

Link errors

Following of my experiments with VC6/Ice...

Also note that while all my attempts to have a working STLPort working have failed, I can now have a decent success compiling some programs with the following command:

cl /nologo /c /GR /D_WIN32_WINNT=0x0400 /Ob1 /Og /Oi /Os /Oy /Gs /Gy /Gf /W1 /MD /GX /Zi /D"_AFXDLL" /D"_LANGUAGE_CPLUSPLUS" /I... /Fo"IHelloWorld.obj" IHelloWorld.cpp

(most of the compiler options come from an automated build system, i cannot change them...)

And I now get the following link errors:

# + link /LIBPATH:"f:\ice-1.4.0\lib" ice.lib iceutil.lib /FORCE:MULTIPLE /DEBUG /DEBUGTYPE:CV /NOLOGO /LARGEADDRESSAWARE /FIXED:NO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /OUT:"Test.exe" @objects.lst

IHelloWorld.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const & __thiscall IceProxy::Ice::Object::__defaultContext(void)const " (__imp_?__defaultContext@Object@Ice@IceProxy@@IBEABV?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@std@@XZ)
IHelloWorld.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall IceInternal::Outgoing::Outgoing(class Outgoing::Connection *,class Outgoing::Reference *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum Ice::OperationMode,class basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &)" (__imp_??0Outgoing@IceInternal@@QAE@PAVConnection@1@PAVReference@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4OperationMode@Ice@@ABV?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@5@@Z)
IHelloWorld.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: void __thiscall IceDelegateD::Ice::Object::__initCurrent(struct Ice::Current &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum Ice::OperationMode,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &)" (__imp_?__initCurrent@Object@Ice@IceDelegateD@@IAEXAAUCurrent@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4OperationMode@2@ABV?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@6@@Z)
IHelloWorld.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual bool __thiscall IceDelegateM::Ice::Object::ice_isA(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &)" (__imp_?ice_isA@Object@Ice@IceDelegateM@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@5@@Z)

...

Is this problem related to the buggy STL or have another cause?

Comments

  • bernard
    bernard Jupiter, FL
    If you use Visual C++ 6, you really need to use STLPort as your STL implementation. I recommend you apply the latest VC6 service pack (SP5) before building STLPort 4.6.x and Ice.

    See http://www.zeroc.com/platforms.html for all supported platform/compiler combinations.

    Cheers,
    Bernard
  • I know that but...

    # + cl /nologo /c /I"F:\STLport-4.6.0\stlport" /GR /D_WIN32_WINNT=0x0400 .... "HelloWorld.cpp"

    F:\STLport-4.6.2\stlport\stl/debug/_debug.h(166) : warning C4005: '_STLP_DEBUG_CHECK' : macro redefinition
    F:\STLport-4.6.2\stlport\stl/_config.h(375) : see previous definition of '_STLP_DEBUG_CHECK'
    F:\STLport-4.6.2\stlport\stl/debug/_debug.h(167) : warning C4005: '_STLP_DEBUG_DO' : macro redefinition
    F:\STLport-4.6.2\stlport\stl/_config.h(376) : see previous definition of '_STLP_DEBUG_DO'
    F:\STLport-4.6.2\stlport\stl/debug/_vector.h(277) : error C2953: 'vector' : template class has already been defined
    F:\STLport-4.6.2\stlport\stl/debug/_vector.h(277) : see declaration of 'vector'
    E:\dev\.\EnoviaNG.tst\ProtectedInterfaces\Ice/Proxy.h(344) : error C2027: use of undefined type 'Object'
    E:\dev\.\EnoviaNG.tst\ProtectedInterfaces\Ice/ObjectF.h(18) : see declaration of 'Object'
    E:\dev\.\EnoviaNG.tst\ProtectedInterfaces\Ice/Proxy.h(344) : error C2039: 'ice_newFacet' : is not a member of 'ProxyHandle<class Ice::Object>'

    ... and counting ...

    I know this is not an Ice issue so i don't bother you with that.
    I just wonder how to setup the whole stuff within VC6.

    note that i have been able to build the STLport libraries without any problem, so i believe i can use ice + stlport.
    I suspect that the build system i use do some very bad things in my back!
    --
    Regards
  • Question subsidiaire...

    Do i need to rebuild Ice once the STLport is installed, or the bundle for VC7 is ok?
  • bernard
    bernard Jupiter, FL
    If you use Visual C++ 6, you need STLPort. Before building Berkeley DB or Ice, you should ensure that the STLPort include directory [named .../include/stlport] is first in the include search path -- before the Microsoft include directories.

    And don't forget to build Berkeley DB with STLPort setup in Visual C++ 6, before building Ice.

    If you use Visual C++ 7.0 or 7.1, it's much simpler. You can use the installers, or if you want to build Ice from scratch, you can use the separate "third party" installer to install the required third party packages.
    And you don't need STLPort (we actually don't support this combination).

    Cheers,
    Bernard