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

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

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

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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?

Leave a Comment

Please sign in to add a comment. Not a member? Join today