STL Link Errors converting from VC7 to VC8

B

Bruce

I am converting a DLL project from VC7 to VC8. The project is a managed
C++ DLL. The project uses a non managed C++ library compiled an
linked in VC7 which uses the STL.

I just about got everything to link with the exception of some STL link
errors.


Here is an example of one of the errors:

error LNK2001: unresolved external symbol "public: void __thiscall
std::_String_base::_Xran(void)const

How do I resolve this?


Bruce
 
C

Carl Daniel [VC++ MVP]

Bruce said:
I am converting a DLL project from VC7 to VC8. The project is a
managed C++ DLL. The project uses a non managed C++ library
compiled an linked in VC7 which uses the STL.

I just about got everything to link with the exception of some STL
link errors.


Here is an example of one of the errors:

error LNK2001: unresolved external symbol "public: void __thiscall
std::_String_base::_Xran(void)const

How do I resolve this?

Recompile the native C++ library (or is it a DLL?) with VC8. In general,
you can't mix C++ standard library versions in a single link, nor can you
transport Standard Library objects (like std::string) across a DLL boundary
if there are different versions on the two sides (e.g. use VC7 to compile a
DLL and VC8 ot use it - likely won't work if there are std::string
parameters/return types to functions exported by the DLL).

-cd
 
B

Bruce

Carl said:
Recompile the native C++ library (or is it a DLL?) with VC8. In general,
you can't mix C++ standard library versions in a single link, nor can you
transport Standard Library objects (like std::string) across a DLL boundary
if there are different versions on the two sides (e.g. use VC7 to compile a
DLL and VC8 ot use it - likely won't work if there are std::string
parameters/return types to functions exported by the DLL).

-cd

Thanks Carl.

It is not a DLL lib but a static lib. But I guess your information
still applies?


I do also have a VC& DLL version of the lib. It does not export
anything from STL. Should this lib still work from VC8?

Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top