[Gtkradiant] defaultlib 'LIBCMTD' conflicts with use of other libs

Nerius Landys nlandys at gmail.com
Sat Jan 29 01:53:21 CST 2011


I compiled libjpeg (jpeg-8c) for Windows, thereby generating a libjpeg.lib
file, which is a statically linked library.

I updated my test project (svn://porky.nerius.com/repos/gtk-test-proj) to
now use bits of code from Gtk+, GtkGlExt, libxml2, and libjpeg.  (If you
want to compile the project in Visual Studio 2008 make sure to first run
gtk-test-proj/setup.sh from MSYS terminal emulator, which will download the
newly compiled external libs Gtk+, GtkGlExt, libxml2, and libjpeg).

When compiling my test project in VS2008, I get a warning, but it still
works OK:

LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other
libs; use /NODEFAULTLIB:library

I've been doing research on how to cleanly resolve this situation and I'm
running a little thin on leads.  I did do this:

========================================================
c:\MinGW\msys\1.0\home\nlandys\jpeg-8c>dumpbin /directives libjpeg.lib
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file libjpeg.lib

File Type: LIBRARY

   Linker Directives
   -----------------
   /DEFAULTLIB:"LIBCMTD"
   /DEFAULTLIB:"OLDNAMES"

   Linker Directives
   -----------------
   /DEFAULTLIB:"LIBCMTD"
   /DEFAULTLIB:"OLDNAMES"

   Linker Directives
   -----------------
   /DEFAULTLIB:"LIBCMTD"
   /DEFAULTLIB:"OLDNAMES"

...
===================================================

Now libjpeg is the only statically linked library so far in my new
collection of libraries, and it is causing the compiler warning above.  The
other libraries, Gtk+ and friends, GtkGlExt, and libxml2, are dynamically
loaded DLLs, and if my project removes libjpeg I no longer get the compiler
warning.

Can someone give me some advice on how to get rid of the Visual Studio 2008
compiler warning?

The further I dive into this Microsoft thingy, the more I hate Microsoft,
actually.  I really see some really weak spots in Microsoft software when
you try to do really nifty things that are otherwise very simple with UNIX.

- Rambetter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://zerowing.idsoftware.com/pipermail/gtkradiant/attachments/20110128/3110f953/attachment.htm 


More information about the Gtkradiant mailing list