views:

14

answers:

1

When trying to link my C++ solution in Visual Studio 2008, I get the message "LNK1104: cannot open file 'stlport_statix.lib'".

I have installed STLport, and the correct path is set in Tools->Options->Projects And Solutions->VC++ Directories->Library Files. STLport does however not provide a file called stlport_statix.lib, only stlport_static.lib.

Where does Visual Studio get the idea to swap the ending 'c' with an 'x'?

Note that this might very well be a real simple mistake, as I am not familiar with the Microsoft stack (coming from a Linux/gcc background).

Edit: I have found out where the 'x' comes from, it means "static STLport lib built with dynamic RTL". The one who built STLPort didn't build that version, since we are not supposed to use it.

Edit2: I am now trying to figure out why Visual Studio is building with /MD, even though the project is set to use /MT under "Code Generation". This seems to be the root of the problem.

A: 

Problem solved. I had a project in the solution using /MD instead of /MT, that I had overlooked.

Long explanation: STLport can be built either for dynamic linking or static linking. It can also be built for static linking, but with a dynamically linked runtime library. The latter results in a library called "stlport_statix.lib", whereas the normal statically linked one is called "stlport_static.lib".

When you are building with STLport, _auto_link.h decides what version to link against, based on whether you are using /MD or /MT.

For details, see _auto_link.h lines 27-39 and _detect_dll_or_lib.h lines 32-65 (assuming STLport 5.2.1).

knatten