Compiling a VC++ 6.0 with VC++ 8.0  
Author Message
agustin_m





PostPosted: Visual C++ General, Compiling a VC++ 6.0 with VC++ 8.0 Top

Hello,

I have a project that was created/build using VC++ 6.0, the project uses a third party library iconnect.lib that was created with VC++ 6.0. I am trying to compile the project using VC++ 8.0 but I get a lot of linker errors - some of those errors are below. Note: the project compiles without errors or warnings when using VC++ 6.0.

Can someone tell me what I need to do to get my project to compile/link successfully with VC++ 8.0

Thanks in advance!

-Agustin

ERRORS:

Error 82 error LNK2001: unresolved external symbol __RTC_CheckEsp iconnect.lib
) iconnect.lib
Error 164 error LNK2001: unresolved external symbol __RTC_CheckEsp SampleMsgHandler.obj
Error 165 error LNK2001: unresolved external symbol __RTC_Shutdown iconnect.lib
) iconnect.lib
Error 169 error LNK2001: unresolved external symbol __RTC_Shutdown iconnect.lib
Error 329 error LNK2001: unresolved external symbol __RTC_InitBase iconnect.lib
) iconnect.lib
Error 412 error LNK2001: unresolved external symbol __RTC_InitBase iconnect.lib
Error 493 error LNK2001: unresolved external symbol ___security_cookie Simple.obj
) Sample.obj
Error 495 error LNK2001: unresolved external symbol ___security_cookie SampleCommands.obj
Error 498 error LNK2001: unresolved external symbol ___CxxFrameHandler3 Simple.obj
Sample.obj
Error 500 error LNK2001: unresolved external symbol ___CxxFrameHandler3 SampleCommands.obj

Sample.obj

) iconnect.lib





) Sample.obj
) SampleCommands.obj
) SampleLog.obj
) SampleMsgHandler.obj
) Sample.obj
) SampleCommands.obj
) iconnect.lib
) iconnect.lib
) iconnect.lib
) iconnect.lib
) iconnect.lib




Visual C++6  
 
 
Peter Ritchie





PostPosted: Visual C++ General, Compiling a VC++ 6.0 with VC++ 8.0 Top

You need to the the third-party library for VC++ 8.0 from the vendor. Visual C++ does not support linking libraries that use one version of the CRT with code that uses another verstion of the CRT.

 
 
agustin_m





PostPosted: Visual C++ General, Compiling a VC++ 6.0 with VC++ 8.0 Top

Peter,

Thanks your reply!

The company that provides the iconnect.lib library does not have a VC++ 8.0 version of the library, they only have 6.0 and 7.0. Do you have any other suggestion

Your help is very appreciated!

-Agustin



 
 
Ted.





PostPosted: Visual C++ General, Compiling a VC++ 6.0 with VC++ 8.0 Top

Another suggestion would be to isolate the functionality you require from this iconnect.lib into a separate DLL. Include this iconnect.lib when linking your new DLL. Create export stub functions in this DLL that the rest of your app can call. Link the new DLL with VC 6.0.

So your main app is in VC8.0, and the isolated functionality you require is in VC 6.0. The import library created by your VC 6.0 DLL will be compatible with the rest of your app.


 
 
Peter Ritchie





PostPosted: Visual C++ General, Compiling a VC++ 6.0 with VC++ 8.0 Top

There's nothing supported you can do to link a lib linked to a different CRT. The problem is that lib is linked to CRT symbols that may or may not be in the new CRT you're linking your application with.

As Ted points out, about the only thing you can do is create a VC6 DLL statically linked to the CRT (or VC7 if you can upgrade your lib to a more recent version) that exposes the functionality of the lib via an alternative interface.

I would complain loudly to the vendor, if they're providing libraries for use with Visual Studio they should produce libraries for current/new versions of Visual Studio in a timely fashion.

 
 
agustin_m





PostPosted: Visual C++ General, Compiling a VC++ 6.0 with VC++ 8.0 Top

Peter and Ted,

Thanks for your input!

I do have a DLL version of the iconnect.lib along with the .lib file to link it with - this was provided by the vendor. I can compile and link using VC++ 8.0 when I use the DLL .lib file but when I run the app I get that 2 other DLL can not be found these are: msvcr70d.dll and MSVCP70.dll.

I downloaded these DLL from the internet placed then in the app folder and I now get this error:

Unhandled exception at 0x7c812a5b in Simple_cpp.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0012f0e4..

This is the code for the main function:

int main(int argc, char** argv)

{

// Sample class for session handling,

// implements callbacks from iCallback

CSample sample;

// Process command line options

CSampleCommands cmds;

if (! cmds.processCommand(argc, argv) )

{

printf( "Usage: %s [-h host:port] [-u username:passwd] [-l loglvl] [-c request:param:...]\n", argv[0] );

while (getchar() != '\n');

return 1;

}

// Create a new session

// add sample as callback to handle received events and messages for the session

iCSession* pSession = &iCSessionMngr::getMngr()->createSession(cmds.getUsername(), cmds.getPassword(), cmds.getHost(), cmds.getPort),&sample );

return 0;

}

-Agustin