Need help to compile mapserver-4.2.2 under windows

Swaminathan, Gayathri gayathri at OU.EDU
Wed Sep 1 11:43:35 EDT 2004


Hi Bai:
I am assuming you are using MSVC6

The linker error "unresolved external symbol _printchar" is because regex.obj,it does not exist in your regex folder or is corrupt.

Resolution: Please recompile with regex to resolve. There have been requests for a regex makefile previously to the list....and you should find one in the archives...if not let me know and I could send you the same.

The other errors: are from your GDAL library...

Can you explain how you compiled GDAL...as to what was enabled in the nmake.opt for GDAL?

Gayathri




> -----Original Message-----
> From: UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Jingyu Bai
> Sent: Wednesday, September 01, 2004 9:49 AM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> 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\freetype21
> 1ST_D.lib
> D:\Projects\mapserver_libraries\proj-4.4.8\src\proj.lib
> D:\Projects\mapserver_libraries\gdal-1.2.1\ogr\ogrsf_frmts\ogr
> sf_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