View Full Version : conflicting in libc.lib and msvcrt.lib
forest
04-21-2009, 09:15 PM
Is there anyway to tell lf95, neglect one of them ?
I am doing mix language programming, C++ and Fortran. As in Visual Studio 2008 Express, the only choice for C runtime library is libcmt.lib and msvcrt.lib. But LF7.1 seems only linked to libc, which has been abandoned by Microsoft.
Is there any way to do it ? I have to staticlink, and even the Lahey Example doesn't work.
tzeis
04-22-2009, 02:20 AM
You can run the ms linker directly, but unless the code is very simple, it is likely the link will fail, because the libc runtime used by lf95 (VC7) is not compatible with the VC runtime that comes with VS2008. You best option is to access either the C++ or the Fortran in a DLL, whichever is not the main is the one that should go into the DLL.
forest
04-22-2009, 03:29 AM
Thanks.
I am not sure if the libc code is already statically linked to Lahey lib, if not, there is an /nodefaultlib option for linker, and I hope I can ignore the libc part, and tell Lahey code to link to MSVCRT or LBCMT whatever supported by VS2008.
This seems not true, I doubt the libc code is already static there. I saw one msvcrt.lib in the lib directory, not sure if it is used by LF95.
tzeis
04-23-2009, 02:35 AM
The problem pops up when you try to mesh the Fortran runtime libs with the new libc. You get unresolved references for things the Fortran runtime libs want that aren't there anymore in the new libc. If it has to be static, then your best bet is to revert to MSVC 7 to get a successful link.
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.