Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

MS VC 2003 / Intel 8.1 linker messages

lmc
初学者
815 次查看
I am getting the following messages when I link my fortran DLL with a C static library:

Linking...
LINK : warning LNK4098: defaultlib 'LIBCD' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
chemtran_dll build succeeded.

What do these error messages mean and do I need to fix something ?

Thanks,
Lynn
0 项奖励
7 回复数
Steven_L_Intel1
815 次查看
See this article for an explanation of the issue. You need to change the "Libraries" Fortran project property to match that used to build the C library.

Message Edited by sblionel on 09-24-2004 03:56 PM

0 项奖励
lmc
初学者
815 次查看
Ah, now I remember why I gave up on CVF 6.6. I never could get this to work to build a mixed C and Fortran Win32 DLL due to this specific issue.

BTW, the correct URL is http://h18009.www1.hp.com/fortran/visual/vfn10/page2.html#Karam .

I am guessing that I need the dfor.lib and libc.lib files but the MS linker says that there is no such beast as dfor.lib.

???

Thanks,
Lynn
0 项奖励
Steven_L_Intel1
815 次查看
Sorry for the bad URL - I fixed it.
If you are seeing references to dfor.lib, then you have objects or libraries that were built with CVF. You must rebuild ALL Fortran sources with Intel Fortran.
It is not hard to solve the mixed-language library problem. Unfortunately, the initial steps many people take just serve to make the matter worse.
Simply put - make the libraries settings match between Fortran and C++ and you should be fine.
0 项奖励
lmc
初学者
815 次查看
Steve,

I have 3 projects in a MS VC++ 2003 solution.

The first project is a MC VC static library with 3 c files. There is no runtime specifable here.

The second project is a IVF Win32 DLL with about 1200 fortran files. The runtime specified was multithreaded dll debug.

The third project is a IVF Win32 console program with 1 fortran file. The runtime specified was multithreaded dll debug.

I tried to run my program under the debugger then but I got a message about not being able to find libifcoremdd.dll.

I changed the specified runtime to single threaded for the 2nd and 3rd projects. I got all kinds of runtime library conflicts for the libc and the libcd libraries.

I then changed the specified runtime to multithreaded. Again, I got all kinds of runtime library conflicts for the libc, etc... libraries.

I then changed the specified runtime to debug multithreaded for the 2nd and 3rd projects.

Thanks,
Lynn
0 项奖励
lmc
初学者
815 次查看
OK, I found the place in the c static library project where I needed to set it to multithreaded DLL also. Now, I got a clean link for the first time.

And, I copied the ivf runtime DLLs into my debug directory.

However, when I run my debug win32 console program, I now get this error message "the application has failed to start because MSVCRTD.DLL was not found". Isnt that a VC6 library ?

Thanks,
Lynn
0 项奖励
lmc
初学者
815 次查看
Finally ! I got a working executable by specifying "multiple threaded DLL" in my fortran exe project, my fortran win32 dll project and my c static library project. I could not use the debug versions since they refer back to the VC6 runtime library !

Wow ! What a pain !

Thanks,
Lynn
0 项奖励
Steven_L_Intel1
815 次查看
Sorry about the MSVCRTD problem. That was a bug that should have been fixed for 8.1, but wasn't. It's being worked on. Don't use "debug dynamic linked library" as the run-time library type in Fortran.
0 项奖励
回复