Need help to compile mapserver-4.2.2 under windows

Brent Fraser bfraser at GEOANALYTIC.COM
Wed Sep 1 11:50:46 EDT 2004


Some notes on compiling Mapserver 4.2.2 on Windows:

Regex:
=====
    Around line 419 of Mapserver 4.2.2 nmake .opt file, change:
REGEX_OBJ=$(REGEX_DIR)\regex.obj
    to
REGEX_OBJ=$(REGEX_DIR)\regex.obj $(REGEX_DIR)\test\printchar.obj


GD v2.0.28
=========
   I haven't figured out how to compile this version of GD yet.  They've
changed their method of function decoration and  VC++ 6 refuses to compile
it (which is strange since their changes seem to be specifically for
Windows;  I'm sure I just need to set some compiler option).  For now I use
your method of downloading the binary package.

SQL Errors
========
Your "SQL" errors may be due to different settings in GDAL's nmake.opt and
Mapserver's nmake.opt.  Check to make sure both have the same value for
ODBC_SUPPORTED.


When your compile is successful, mapserv.exe will be created (and other
exes), and libmap.dll

The Mapserver compile How-to explains about some of the executables and
dlls.

Brent Fraser


----- Original Message -----
From: "Jingyu Bai" <baijingyu at HOTMAIL.COM>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Wednesday, September 01, 2004 8:48 AM
Subject: [UMN_MAPSERVER-USERS] Need help to compile mapserver-4.2.2 under
windows


> We have to use it under windows and need to compile it by changing some
> parameters. I am following the instruction "MapServer Win32 Compilation
and
> Installation HOWTO"(a little bit old) and the reame.win32 file coming from
> mapserver downloaded source file of version mapserver-4.2.2. I can
> successfully compiled some supporting libraries such as gdal-1.2.1 /
> freetype-2.1.3 / curl-7.12.1 / proj-4.4.8 /zlib121. The other libraries
> like GD library I can't compile it (no make file for windows)instead I
> downloaded a binary DLL version gd-2.0.28 and used "makemsvcimport.bat" to
> build bgd.lib . I can't compile REGEX library neither (no make file for
> windows) but I found one version from internet which is win32 port of GNU
> REGEX. Now I modified the nmake.opt file to comment unnecessary optional
> lines and then change the libraries path to point to my real libraries
> location. I run "nmake /f Makefile.vc" and got error in the end as the
> following. I hit the wall and and can't figure out which library is wrong
> or missing. Could somebody in this user group help me out? I really
> appreciate your help.
>
> ========= compiler error message ========
> ....
>   Creating library mapserver_i.lib and object mapserver_i.exp
> LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other
> libs; use /NODEFAULTLIB:library
> regex.obj : error LNK2001: unresolved external symbol _printchar
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLFreeEnv at 4
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLFreeConnect at 4
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLDisconnect at 4
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLError at 32
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLConnect at 28
>
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLSetConnectOption at 12
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLAllocConnect at 8
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLAllocEnv at 4
>
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLAllocStmt at 8
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLFreeStmt at 8
>
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLExecDirect at 12
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLDescribeCol at 36
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLNumResultCols at 8
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLGetData at 24
>
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLFetchScroll at 12
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLFetch at 4
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLColumns at 36
>
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLPrimaryKeys at 28
> cpl.lib(cpl_odbc.obj) : error LNK2001: unresolved external symbol
> _SQLTables at 36
> libmap.dll : fatal error LNK1120: 20 unresolved externals
> NMAKE : fatal error U1077: 'link' : return code '0x460'
> Stop.
>
> I tried "nmake /f Makefile.vc" again right after the above failure and got
> different:
> ======== compiler error message ========
> ...
>         link /NODEFAULTLIB:msvcrt /NODEFAULTLIB:libcd /DEBUG mapserv.obj
> mapserver_i.lib D:\Projects\mapserver_libraries\gdwin32\bgd.lib
> D:\Projects\mapserver_libraries\libpng\libpng.lib
> D:\Projects\mapserver_libraries\zlib121src\zlib.lib
> D:\Projects\mapserver_libraries\freetype-2.1.3\objs\freetype211ST_D.lib
> D:\Projects\mapserver_libraries\proj-4.4.8\src\proj.lib
> D:\Projects\mapserver_libraries\gdal-1.2.1\ogr\ogrsf_frmts\ogrsf_frmts.lib
> D:\Projects\mapserver_libraries\gdal-1.2.1
> \ogr\ogrsf_frmts\ogrsf_frmts_sup.lib D:\Projects\mapserver_libraries\gdal-
> 1.2.1\ogr\ogr.lib D:\Projects\mapserver_libraries\gdal-1.2.1
> \ogr\..\port\cpl.lib D:\Projects\mapserver_libraries\gdal-1.2.1\gdal_i.lib
> D:\Projects\mapserver_libraries\curl-7.12.1\lib\libcurl.lib "C:\Program
> Files\Microsoft Visual Studio\VC98\Lib\WSOCK32.LIB"
> Microsoft (R) Incremental Linker Version 6.00.8168
> Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
>
> mapserv.obj : error LNK2001: unresolved external symbol _regfree
> mapserv.obj : error LNK2001: unresolved external symbol _regcomp
> mapserv.obj : error LNK2001: unresolved external symbol _regexec
> mapserv.exe : fatal error LNK1120: 3 unresolved externals
> NMAKE : fatal error U1077: 'link' : return code '0x460'
> Stop.
>
> It seems mapserver.lib and mapserver_i.lib were created but no exe file
> there. What are expected files be generated if compile process is
> successful? Why do I see the map server binary distribution has bunch of
> DLLs there and many exe files in bin folder? Will I get the same result?



More information about the mapserver-users mailing list