Archived

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

STLPort link error

Hi, I'm building ICE 1.0.1 on Windows XP -- VC 6.0 SP 5 (release configuration) and I'm getting a link error:

Creating library Release/slice101.lib and object Release/slice101.exp
Grammar.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > __cdecl IceUtil::generateUUID(void)" (__imp_?generateUUID@IceUtil@@YA?AV?$basic_
string@DV?$char_traits@D@_STL@@V?$allocator@D@2@@_STL@@XZ)
Release/slice101.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

I'm using VC++ 6.0 -- This looks like a STLPort issue. I did the default "make install" with STLPort which copies the STLPort .lib files to Developer Studio\vc98\lib -- I can see them there. However they're not picked up -- Are the names of the STLPort lib files specified somewhere in the project settings or do I need to set something?

Thanks!

Comments

  • Are you sure that you are using the STLport include files, instead of the standard Visual C++ include files? You must add the ...\include\stlport directory to your include path, before any of the system includes. From INSTALL.WINDOWS:
    If you're using STLport, also add the include files for STLport. (Note that you must add the include\stlport directory, not just "include".)

    You don't need to explicitly link any STLport libraries -- the STLport headers take care of this (provided that you use them :)).
  • I'm pretty sure...

    The first line in my "include files is"

    C:\DEVSTUDIO\VC98\INCLUDE\STLPORT

    (which is where they're copied when you run 'nmake -f vc6.mak install' and have set your VC++ variables correctly.

    I think it's finding the include files correctly, because previously I was getting some errors with "base64.cxx" before I put the STLPORT at the top and that problem went away, so I think it's picking them up :-/
  • Okay I figured out the problem -- it actually was related to the previous problem of not having the include path correct. I had compiled a few files, but then changed the include settings. I forgot to do a clean recompile, so some of the .obj files had references to the VC++ STL files in them, I'm betting.

    Cleaning and rebuilding cleared up the problem. Sorry ;-)