[gdal-dev] broken trunk build on Win

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Apr 12 11:24:10 EDT 2012


Hi Joaquim,

I've definitely been in a similar situation before.  Most of the time,
when I get those 'LIBCMT' or 'MSVCRT' conflict messages, it is because I
built a dependent library with the /MT option by mistake, causing the
GDAL built to try to include LIBCMT.lib (but GDAL and all of its
dependecies are built with /MD).

As an aside, for everyone reading: I'm kind of surprised to read that
many GDAL-win devs are using MSVC2010 now, I use MSVC2008 because so
many of GDAL's libraries barely 'support' that older version, let alone
the latest.  I guess I should look at upgrading to MSVC2010, but I'm
extremely scared about if/how I'll be able to compile some of those
trickier/barely-supported windows dependencies with the new version.

-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/





On 12-04-12 9:44 AM, Joaquim Luis wrote:
> Hi,
> 
> I made some false reports in the past about the build failures that
> ended up being caused by no starting by a "make clean", but that is not
> the case this time.
> 
> I'm getting these errors on linking the current head.
> 
> Joaquim
> 
> LIBCMT.lib(dosmap.obj) : error LNK2005: _errno already defined in
> MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(crt0dat.obj) : error LNK2005: _initterm_e already defined in
> MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(crt0dat.obj) : error LNK2005: exit already defined in
> MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(crt0dat.obj) : error LNK2005: _amsg_exit already defined in
> MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(tidtable.obj) : error LNK2005: _encoded_null already defined
> in MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(crtheap.obj) : error LNK2005: _malloc_crt already defined in
> MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(mlock.obj) : error LNK2005: _unlock already defined in
> MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(mlock.obj) : error LNK2005: _lock already defined in
> MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)"
> (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_a already defined in
> MSVCRT.lib(cinitexe.obj)
> LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_z already defined in
> MSVCRT.lib(cinitexe.obj)
> LIBCMT.lib(crt0init.obj) : error LNK2005: __xc_a already defined in
> MSVCRT.lib(cinitexe.obj)
> LIBCMT.lib(crt0init.obj) : error LNK2005: __xc_z already defined in
> MSVCRT.lib(cinitexe.obj)
> LIBCMT.lib(mbctype.obj) : error LNK2005: _getmbcp already defined in
> MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(winxfltr.obj) : error LNK2005: __CppXcptFilter already
> defined in MSVCRT.lib(MSVCR100.dll)
> LIBCMT.lib(lconv.obj) : error LNK2005: localeconv already defined in
> MSVCRT.lib(MSVCR100.dll)
> MSVCRT.lib(MSVCR100.dll) : error LNK2005: _setmode already defined in
> LIBCMT.lib(setmode.obj)
> MSVCRT.lib(MSVCR100.dll) : error LNK2005: _close already defined in
> LIBCMT.lib(close.obj)
> MSVCRT.lib(MSVCR100.dll) : error LNK2005: _open already defined in
> LIBCMT.lib(open.obj)
>    Creating library gdal_i.lib and object gdal_i.exp
> LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
> libs; use /NODEFAULTLIB:library
> LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
> libs; use /NODEFAULTLIB:library
> LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main
> referenced in function __tmainCRTStartup
> gdal_w64.dll : fatal error LNK1120: 1 unresolved externals
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 



More information about the gdal-dev mailing list