Compiling MapScript.dll for C# (SWIG)

Sean Gillies sgillies at FRII.COM
Thu Feb 17 06:30:32 PST 2005


On Feb 17, 2005, at 2:09 AM, Morten Nielsen wrote:

> I'm trying to compile the mapscript.dll using SWIG, and have a problem
> during linking. Compiling generates three compile warnings, which
> prevents
> the linker from linking the obj-files. Does anyone have an idea for a
> workaround or know how to resolve this?
>
>
>
> Regards
> /Morten Nielsen
> www.dotnetgis.net
>
> -----------------------------------------------------------------------
> -
> ----------------------------------
>
> C:\GIS\Mapserver\4.4.1\source\mapscript\csharp>nmake /f makefile.vc
>
> Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright
> (C)
> Microsoft Corporation.  All rights reserved.
>
> c:/GIS/Mapserver/SWIG-1.3.24/swig -csharp -o mapscript_wrap.c
> ../mapscript.i
> cl /nologo /Zi /W3 /DDEBUG -DWIN32 -D_WIN32
> -Ic:/GIS/Mapserver/RequiredLibraries/gdwin32
> -Ic:\GIS\Mapserver\RequiredLibraries\proj-4.4.9/src
> -Ic:\GIS\Mapserver\RequiredLibraries\regex-0.12 -DHAVE_STRING_H
> -DREGEX_MALLOC -DNEED_STRCASECMP -DNEED_STRNCASECMP -DNEED_STRLCAT
> -DWIN32 -D_WIN32 -DUSE_PROJ -DUSE_PROJ_API_H -DUSE_GD_PNG -DUSE_GD_JPEG
> -DUSE_GD_WBMP -DUSE_GD_GIF -DGD_HAS_GDIMAGEGIFPTR -DUSE_GD_FT
> -DGD_HAS_GETBITMAPFONT  -DUSE_WMS_SVR -D IGNORE_MISSING_DATA
> -DENABLE_STDERR_DEBUG -DUSE_GD_ANTIALIAS -I../..
> /DCOMPILE_DL=1 /c mapscript_wrap.c /Fomapscript_wrap.obj
> mapscript_wrap.c
> mapscript_wrap.c(766) : warning C4013: 'msSLDApplySLD' undefined;
> assuming
> extern returning int
> mapscript_wrap.c(769) : warning C4013: 'msSLDApplySLDURL' undefined;
> assuming extern returning int
> mapscript_wrap.c(772) : warning C4013: 'msSLDGenerateSLD' undefined;
> assuming extern returning int
>
> link /NODEFAULTLIB:msvcrt /NODEFAULTLIB:libcd /dll /debug
> /out:mapscript.dll
> mapscript_wrap.obj ../../mapserver_i.lib
> c:/GIS/Mapserver/RequiredLibraries
> /gdwin32/bgd.lib
> c:\GIS\Mapserver\RequiredLibraries\proj-4.4.9/src/proj_i.lib
>
> Microsoft (R) Incremental Linker Version 7.10.3077 Copyright (C)
> Microsoft
> Corporation.  All rights reserved.
>
> Creating library mapscript.lib and object
> mapscript.expmapscript_wrap.obj :
> error LNK2019: unresolved external symbol _msSLDApplySLD referenced in
> function _layerObj_applySLD mapscript_wrap.obj : error LNK2019:
> unresolved
> external symbol _msSLDApplySLDURL referenced in function
> _layerObj_applySLDURL mapscript_wrap.obj : error LNK2019: unresolved
> external symbol _msSLDGenerateSLD referenced in function
> _layerObj_generateSLD mapscript.dll : fatal error LNK1120: 3 unresolved
> externals NMAKE : fatal error U1077: 'link' : return code '0x460'
> Stop.
>

This bug occurs because libmap lacks proper stubs for msSLDApplySLD,
msSLDApplySLDURL, and msSLDGenerateSLD.  Until that is fixed, you have
2 options: 1) hack your mapscript.cs and mapscript_wrap.c files to
comment out these functions or 2) build WMS server and client support
into your libmap.

I've entered a new bug into our tracker:

   http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1247

Add yourself to the cc list to follow progress.

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies



More information about the MapServer-users mailing list