Home Help Center

link error with stl

simpleysimpley Member ✭✭
I want to compile ICE on windows 200 professional with vc6.0, whatever I compile the all.dsw or slice.dsp, the compiler always told me the.
/////////////////////////////////////////////////////////////////////////////////////////
Configuration: Slice - Win32 Debug
Linking...
Creating library Debug/sliced.lib and object Debug/sliced.exp
Parser.obj : error LNK2001: unresolved external symbol "public: static void __cdecl _STL::_STLP_mutex_spin<0>::_M_do_lock(long volatile *)" ([email protected][email protected][email protected]@[email protected]@[email protected])
Debug/slice11d.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

slice11d.dll - 2 error(s), 0 warning(s)
////////////////////////////////////////////////////////////////////////////////////////

who can tell me how to continue, thanks.

Comments

  • Jeff HolleJeff Holle Member
    I'm guessing, but it looks like the problem is a multi-threaded resource can't be found.

    Perhaps this is because you didn't specify that you were compiling a mulit-threaded application?
  • simpleysimpley Member ✭✭
    thanks your suggestion first, but I have choose the "debug mutilthread dll" in the option of vc6.0, so I think it enough?
    I found the reason, there is no any symbol as "_STLP_mutex_spin" export in the lib file of portstl . but I do not know how to make it.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    I'm not sure what could cause this problem. First, can you make sure that the path to the STLport library files are correctly setup your Visual C++ options?

    In particular, in the IDE menus "Tools->Options->Directories", can you check that the STLport library directory is correctly setup in the list of directories under the "Show Directories for: -> Library files" panel?

    How did you compile STLport? Could you send us your "include/stlport/stl_user_config.h" file so that we can compare with the one we're using?

    If this still doesn't work, can you enable write build logs in the Visal C++ options (in the "Tools -> Options -> Build" tab) and send us the build log file for the Slice library after trying to build it (the file should be: Ice-1.1.0\src\Slice\Slice.plg)?


    Benoit.
  • simpleysimpley Member ✭✭
    thanks your help first.

    1. in my "Library files" panel, my library files has a item such as "D:\ICE\DEVELOP\STLPORT\STLPORT-4.5.3\STLPORT-4.5.3\LIB",
    there are two lib files in this dir, one is "stlport_vc6_stldebug.lib", another is "stlport_vc6_stldebug_static.lib",
    so when I built slice after I hide the "stlport_vc6_stldebug.lib", the compiler told me it need this file,
    so I thought slice depend on it, but I can not find any symbol such as "_STLP_mutex_spin<" in this lib file, against,
    I find such symbol in "stlport_vc6_stldebug_static.lib", but I can not changed the dependence of slice.

    2. in my dir as "D:\ICE\Develop\Ice\Ice-1.1.0\include", there is no such "stlport" subdirectory, but I find file named "stl_user_config.h"
    in "D:\ICE\Develop\STLport\STLport-4.5.3\STLport-4.5.3\stlport" , but it is all remarked with // and /* */.

    3.I rebuild slice again, and there is the content of file "Slice.plg":

    ==========================================================================
    Build Log

    Configuration: IceUtil - Win32 Debug

    Command Lines
    Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP187.tmp" with contents
    [
    /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I ".." /I "../../include" /D "_USRDLL" /D "ICE_UTIL_API_EXPORTS" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\Base64.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\Cond.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\CtrlCHandler.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\Exception.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\InputUtil.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\OutputUtil.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\RecMutex.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\RWRecMutex.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\StaticMutex.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\Thread.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\ThreadException.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\Time.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\Unicode.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\UUID.cpp"
    ]
    Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP187.tmp"
    Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP188.tmp" with contents
    [
    rpcrt4.lib /nologo /dll /incremental:yes /pdb:"Debug/iceutil11d.pdb" /debug /machine:I386 /out:"Debug/iceutil11d.dll" /implib:"Debug/iceutild.lib"
    ".\Debug\Base64.obj"
    ".\Debug\Cond.obj"
    ".\Debug\CtrlCHandler.obj"
    ".\Debug\Exception.obj"
    ".\Debug\InputUtil.obj"
    ".\Debug\OutputUtil.obj"
    ".\Debug\RecMutex.obj"
    ".\Debug\RWRecMutex.obj"
    ".\Debug\StaticMutex.obj"
    ".\Debug\Thread.obj"
    ".\Debug\ThreadException.obj"
    ".\Debug\Time.obj"
    ".\Debug\Unicode.obj"
    ".\Debug\UUID.obj"
    ]
    Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP188.tmp"
    Output Window
    Compiling...
    Base64.cpp
    Cond.cpp
    CtrlCHandler.cpp
    Exception.cpp
    InputUtil.cpp
    OutputUtil.cpp
    RecMutex.cpp
    RWRecMutex.cpp
    StaticMutex.cpp
    Thread.cpp
    ThreadException.cpp
    Time.cpp
    Unicode.cpp
    UUID.cpp
    Generating Code...
    Linking...
    Creating library Debug/iceutild.lib and object Debug/iceutild.exp
    Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP18C.bat" with contents
    [
    @echo off
    copy .\Debug\iceutild.lib ..\..\lib
    copy .\Debug\iceutil11d.pdb ..\..\bin
    copy .\Debug\iceutil11d.dll ..\..\bin
    ]
    Creating command line "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP18C.bat"

    ÒѸ´ÖÆ 1 ¸öÎļþ¡£
    ÒѸ´ÖÆ 1 ¸öÎļþ¡£
    ÒѸ´ÖÆ 1 ¸öÎļþ¡£

    Configuration: icecpp - Win32 Debug

    Command Lines
    Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP18D.tmp" with contents
    [
    /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../include" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\icecpp\cccp.c"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\icecpp\cexp.c"
    ]
    Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP18D.tmp"
    Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP18E.tmp" with contents
    [
    /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /I "." /I "../../include" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "__STDC__" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\icecpp\prefix.c"
    ]
    Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP18E.tmp"
    Creating command line "link.exe setargv.obj advapi32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/icecpp.pdb" /debug /machine:I386 /out:"Debug/icecpp.exe" /pdbtype:sept /libpath:"../../lib" ".\Debug\cccp.obj" ".\Debug\cexp.obj" ".\Debug\prefix.obj" "
    Output Window
    Compiling...
    cccp.c
    cexp.c
    Generating Code...
    Compiling...
    prefix.c
    Linking...
    Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP190.bat" with contents
    [
    @echo off
    copy .\Debug\icecpp.exe ..\..\bin
    ]
    Creating command line "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP190.bat"

    ÒѸ´ÖÆ 1 ¸öÎļþ¡£

    Configuration: Slice - Win32 Debug

    Command Lines
    Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP191.tmp" with contents
    [
    /nologo /MDd /W3 /WX /Gm /GR /GX /Zi /Od /Ob1 /I ".." /I "../../include" /I "dummyinclude" /D "_USRDLL" /D "SLICE_API_EXPORTS" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\Slice\CPlusPlusUtil.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\Slice\Grammar.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\Slice\JavaUtil.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\Slice\Parser.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\Slice\Preprocessor.cpp"
    "D:\ICE\Develop\Ice\Ice-1.1.0\src\Slice\Scanner.cpp"
    ]
    Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP191.tmp"
    Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP192.tmp" with contents
    [
    /nologo /dll /incremental:yes /pdb:"Debug/slice11d.pdb" /debug /machine:I386 /out:"Debug/slice11d.dll" /implib:"Debug/sliced.lib"
    ".\Debug\CPlusPlusUtil.obj"
    ".\Debug\Grammar.obj"
    ".\Debug\JavaUtil.obj"
    ".\Debug\Parser.obj"
    ".\Debug\Preprocessor.obj"
    ".\Debug\Scanner.obj"
    "\ICE\Develop\Ice\Ice-1.1.0\src\IceUtil\Debug\iceutild.lib"
    ]
    Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP192.tmp"
    Output Window
    Compiling...
    CPlusPlusUtil.cpp
    Grammar.cpp
    JavaUtil.cpp
    Parser.cpp
    Preprocessor.cpp
    Scanner.cpp
    Generating Code...
    Linking...
    Creating library Debug/sliced.lib and object Debug/sliced.exp
    Parser.obj : error LNK2001: unresolved external symbol "public: static void __cdecl _STL::_STLP_mutex_spin<0>::_M_do_lock(long volatile *)" ([email protected][email protected][email protected]@[email protected]@[email protected])
    Debug/slice11d.dll : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    Results
    slice11d.dll - 2 error(s), 0 warning(s)
    ============================================================================================
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    It should link against the stlport_vc6_stldebug.lib import library if your building a debug version of Ice and against the stlport_vc6.lib import library if your building a release version. We don't support compiling with static libraries.

    STLport header files (STLport-4.5.3/include/stlport/config/stl_select_lib.h) decide which version of the import library to use depending on the symbols defined when you build.

    I'm afraid I don't know what's wrong with your STLport library. I think I would try to recompile it from scratch, making sure that your environment is clean and correctly setup (make sure to run vcvars32.bat before starting build STLport).

    Can you also make sure you've got the latest Visual C++ service pack? You should have the following DLL versions if SP5 is installed:

    c1.dll - version 12.0.8867.0
    c1xx.dll - version 12.0.8964.0

    These DLLs are located in C:\Program Files\Microsoft Visual Studio\VC98\BIN

    If this still doesn't work, I could send you the binaries of the STLport library we are using to see if it helps.

    Benoit.
  • simpleysimpley Member ✭✭
    I know why I can not link it well , just as I have said before,
    there is no any symbol such as "_STLP_mutex_spin" in stlport_vc6_stldebug.lib which I built out, but I can find out this symbol in the stlport_vc6_stldebug_static.lib, anyone knows why?
    yeah, my vc6.0 has not packed with the sp5, I will try it again, but it will take serval days, thanks lots all of you
    BTW, benoit, could your post me the binaries of the STLport library, thanks again, and your stlport_vc6_stldebug.lib file content the symbol suck as "_STLP_mutex_spin" ?
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    I think it's actually expected to not find the definition of the symbol in the stlport_vc6_stldebug.lib file. For DLLs, this file only contains the list of exported symbols from the DLL, not the definitions (unlike static libraries).

    I'm attaching a build of the STLport debug library that I'm using to build Ice. Let us know if that works better with this build. If it doesn't, the next step would be to try with the Service Pack 5 since this really looks like a compile problem.

    Benoit.

    PS: I can't manage to attach the zip file... I'll attach it as soon as I figure out why... alternatively, you can send me your email address and I'll send it to you by email.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Here's the attachment!

    Benoit.
  • simpleysimpley Member ✭✭
    thanks benoit again I will try immediately!
  • simpleysimpley Member ✭✭
    Benoit, I can not found the symbol of "_STLP_mutex_spin" in your lib, so I thought it is not business of it.
    but I have packed the sp5 of vc6.0, the problem is still, I would give up anymore, who can tell me how can I get a binary version of ICE on windows2000?
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    As explained in my previous post, I think it's normal that the symbol is not defined in the stlport_vc6_stldebug.lib file. This file doesn't contain symbol definitions. It only contains a list of exported symbols from the DLL. Since this symbol is not exported (see its definition in STLport-4.5.3/include/stlport/stl/_threads.h), it's expected to *not* find it in the import library.

    Why is the compiler creating a dependency on this symbol while compiling Parser.cpp? I'm afraid, I've no idea -- this symbol is only used internally by STLport so it shouldn't show up here.

    Did you try to rebuild everything from *scratch* using the STLport library I've sent you with Visual Studio SP5?

    Benoit.
Sign In or Register to comment.