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

warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library

anthonyrichards
New Contributor III
945 Views
When linking debug version, static debug libraries used. What causes this warning? Can I ignore it? LIBC.LIB is not on the project settings list of libraries to be searched (these are kernel32.lib user32.lib gdi32.lib winspool.lib uuid.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib odbccp32.lib )
(It is a standard WIn32 application compiled and linked using CVF 6.6c, but also including a C++ compiled .OBJ module that contains theWinMain)
P.S. I have just tried it and the 'release' version compiles and links with NO warning.

Message Edited by anthonyrichards on 05-31-200606:37 AM

0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
945 Views
If that's the first time you saw it, you didn't deal with mixed-language and static libraries long enough :-).

Short answer: make sure that Project/Settings/Fortran/Libraries/Run-time library are the same (doesn't quite matter which) as the one from .../C++/Code Generation/Run-time library. (Which in turn should be the same as the one used for compiling the C++ .obj file).

The external .obj/.lib files in general should be compiled with /Zi option, which suppresses embedding of RTL-including directives in .obj file (so that you don't get LNK4098 when linking it latter). I can't find the C++ option for individual files in the IDE, though, but I know that VC++ 6 Wizard for library files sets it up, so you might create a new C++ static library project and use the .lib instead of .obj.

Long answer... do you want a long answer?
0 Kudos
Reply