[Gdal-dev] Compile GDAL with VS2005 (BuildKit Source Code)

Howard Butler hobu at iastate.edu
Wed Jun 14 16:14:35 EDT 2006


Zhonghai,

Yes GDAL can be compiled with MSVC 6, MSVC 2003, and MSVC 2005 -- 
from scratch  The buildkit on hobu.stat.iastate.edu is *specifically* 
for MSVC 2003.  This is because all of the "support" libraries have 
been compiled for you.  For example, in your pasted output, it is 
complaining about linkage errors with GEOS.  This is because GEOS was 
compiled with MSVC 2003, and the two C++ runtimes (MSVC 2003 (7.1) 
and MSVC 2005 (8.0)) are incompatible.  To successfully use the 
buildkit, you would have to recompile *every* library that 
MapServer/GDAL brings in with MSVC 2005.

The buildkit is not of much use if you have to recompile everything 
for your compiler platform.  Maybe someday, when I get MSVC 2005, I 
will roll out a buildkit for that as well.  In the interim, you are 
probably best off by downloading everything you need as source and 
building it all up individually.  Alternatively, you could switch to 
MSVC 2003 and use the buildkit, or start with the buildkit and go in 
and recompile each and every support library that you plan to 
link/use with MapServer/GDAL and MSVC 2005.

Howard




At 03:04 PM 6/14/2006, Zhonghai Wang wrote:
>hi there,
>
>been pasted this message in MapServer mailing list, but I realized 
>that it may be better if I paste it here, since it's GDAL problem. 
>Sorry for the duplicated message.
>
>I am trying to compile GDAL with VS2005, but there are  a lot of 
>error messages after the namake /f <http://makefile.vc>makefile.vc 
>command. Here is what I have done:
>
>1.source code download: -- the MapServer BuildKit from Howard Butler
> 
><http://hobu.stat.iastate.edu/mapserver/build_output/>http://hobu.stat.iastate.edu/mapserver/build_output/
>    and I have downloaded the latest package version 
> "mapserver-4.8.3-2-msvc71-buildk-kit.zip"
>2.and I follow the compilation guide here:
> 
><http://www.nabble.com/Windows-build-kit-for-MSVC-7.1-t1143108.html#a2997024>http://www.nabble.com/Windows-build-kit-for-MSVC-7.1-t1143108.html#a2997024 
>
>    to compile MapServer, according to this doc, I should at first 
> compile the GDAL package, and then come to the MapServer package. 
> But when I am trying to compile the GDAL
>    package under VS2005 command prompt with the command "nmake /f 
> <http://makefile.vc/>makefile.vc", there are some error messages 
> appears, the scenario is:
>********************************
>*C:\buildkit\gdal-1.3.2>nmake /f <http://makefile.vc/>makefile.vc clean
>*C:\buildkit\gdal-1.3.2>nmake /f <http://makefile.vc/>makefile.vc
>*
>*
>*
>*and here come the error messages, I paste only the first one here, 
>because I think if I fix this problem, the other error may be fixed 
>at the same time:
>*
>*msvcprt.lib(MSVCP80.dll) : error LNK2005: "class 
>std::basic_string<char,struct s
>*td::char_traits<char>,class std::allocator<char> > __cdecl 
>std::operator+<char,s
>*truct std::char_traits<char>,class std::allocator<char> >(class 
>std::basic_strin
>*g<char,struct std::char_traits<char>,class std::allocator<char> > 
>const &,char c
>*onst *)" 
>(<http://www.nabble.com/user/SendEmail.jtp?type=post&post=4867349&i=0> 
>??$?HDU?$char_traits at ...*
>*<http://www.nabble.com/user/SendEmail.jtp?type=post&post=4867349&i=1>*@...) 
>already defined in geos
>*.lib(WKTReader.obj)
>*
>*********************************
>I am really confused now, i am just wondering if GDAL can be 
>compiled with VS2005, or it can only be compiled with VC ++ 6?
>
>thanks for any information.
>
>zhonghai
>_______________________________________________
>Gdal-dev mailing list
>Gdal-dev at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/gdal-dev




More information about the Gdal-dev mailing list