R: [Mapserver-users] Compiling mapserver with gdal

Frank Warmerdam warmerdam at pobox.com
Wed Mar 31 07:42:17 PST 2004


Ballini Yvain wrote:
> I've set:
> 
> OPTFLAGS=	/nologo /Ox /MT $(WARNING_LEVEL) $(DEBUG)
> LINKER_FLAGS =	 /NODEFAULTLIB:libcmt /DEBUG and it gives me:
> 
> Creating library gdal_i.lib and object gdal_i.exp
> ogr.lib(ogrct.obj) : error LNK2019: unresolved external symbol __HUGE referenced in function "public: virtual int __thiscall OGRProj4CT::TransformEx(int,double *,double *,double *,int *)" (?TransformEx at OGRProj4CT@@UAEHHPAN00PAH at Z)
> gdal12.dll : fatal error LNK1120: 1 unresolved externals
> 
> If set only
> OPTFLAGS=	/nologo /Ox /MT $(WARNING_LEVEL) $(DEBUG)
>  it gives me a lot of runtime libraries conflicts
> 
> LIBCMT.lib(dosmap.obj) : error LNK2005: __errno already defined in MSVCRT.lib(MSVCR71.dll)
> ----------
> MSVCRT.lib(MSVCR71.dll) : warning LNK4006: __stricmp already defined in LIBCMT.lib(stricmp.obj); second definition ignored
> MSVCRT.lib(MSVCR71.dll) : warning LNK4006: __strnicmp already defined in LIBCMT.lib(strnicmp.obj); second definition ignored
> MSVCRT.lib(MSVCR71.dll) : warning LNK4006: __strdup already defined in LIBCMT.lib(strdup.obj); second definition ignored
>    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 _mainCRTStartup
> gdal12.dll : fatal error LNK1120: 1 unresolved externals

Yvain and others,

I have done a test build of GDAL with /MT (and no /NODEFAULT:libcmt) and
it seems to work just fine for me.  I haven't tried to build MapServer
because it seems like it might be a big job compiling all the other
MapServer components (libcurl, gd, etc) with /MT.

I presume you are using /NODEFAULTLIB:libcmt with MapServer when you get
the missing function stuff?  Well, you can't ... the run runtime library
is needed!

I would imagine you are getting lots of conflicts when you let libcmt get
included because some of the other components (or possily mapserver itself)
is not being compiled with /MT.  You will have to dig through the makefiles
for those packages to deal with that problem.

For now I am going to assume folks issues with /MT and MapServer have nothing
to do with GDAL and are really just a failure to get all packages in the same
mode.  I will try to skim this thread but for if you need to get my attention
again do something direct (like email me directly with a new title).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the MapServer-users mailing list