- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm in the middle of working on a mixed C/FOTRAN project. I hope I'm not revisiting an already visited issue here, but I couldn't find any information when I searched the forums or the support site.
This thing is ported from Unix by a bunch of former mainframe guys. Seriously, they think in terms of cards and decks here. Needless to say, there's no GUI. I get to use makefiles (fun!).
Now there are some peculiar errors occurring, so I decided to build my executable in debug form, linked to the multi-threaded debug DLL versions of the C and FORTRAN libraries. Everything compiles just fine, but at link time, I get this:
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
Knowing that this is usually a quick ticket to death, I double-checked my compiler options. I'm using Visual C++ .NET 2003 and Intel Fortran 8.0.050. Stripping the include directories, the compilers receive, respectively:
cl.exe /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "FORTRANIFACE='IVF'" /RTC1 /MDd/W3 /nologo/c /Zi
ifort.exe /nologo /Zi /Od /traceback /check:bounds /libs:dll /threads /dbglibs /c
Now I've double-checked both MSDN and the Intel references, and unless I'm missing something totally obvious (quite possible), that should have worked. Both are supposed to compile to the multi-threaded debug DLL versions of the runtime libraries, right?
For the sake of completeness, I did a DUMPBIN /DIRECTIVES on two of the .OBJ files -- one from the C++ compiler and one from Fortran. The C file has these:
Linker Directives
-----------------
/DEFAULTLIB:"MSVCRTD"
/DEFAULTLIB:"OLDNAMES"
The Fortran file had these:
Linker Directives
-----------------
-defaultlib:ifconsol
-defaultlib:libifcoremdd
-defaultlib:libifportmd
-defaultlib:libmmdd
-defaultlib:MSVCRT
-defaultlib:libircmt
-defaultlib:OLDNAMES
So the C files are trying to link againstMSVCRTD, but the Fortran files are pulling inMSVCRT. Thus, the warning...
What am I missing here?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue is more complex than I first remembered..
Unless you have VS98/VC6/CVF installed on your system, you don't want to link against the ifort debug DLLs. That's because they reference MSVCRTD.DLL which is available only in the older products. Starting with VS.NET 2002, Microsoft changes the name of this DLL.
We're fixing this for the next release by making the Fortran libraries not dependent on the MS debug DLL.
So what I would suggest for now is that you not use /dbglibs and don't build against the MSVC debug libs either, unless you really have a need for that.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page