[FWTools] Connecting FWTools/OGR to g++

Mateusz Loskot mateusz at loskot.net
Sun Jul 16 08:19:56 EDT 2006


Chris Everhart wrote:
> [...]
> And here is the result (with gcc):
> Owner at dworksgis /cygdrive/c/Program Files/FWTools1.0.5
> $ gcc -I "C:/Program Files/FWTools1.0.5/include" geotest.cpp
> In file included from C:/Program Files/FWTools1.0.5/include/cpl_port.h:156,
>                 from C:/Program Files/FWTools1.0.5/include/gdal.h:135,
>                 from geotest.cpp:1:
> c:/MinGW/include/math.h:672: declaration of C function `float
> _copysign(float,
>   float)' conflicts with
> c:/MinGW/include/math.h:671: previous declaration `double _copysign(double,
>   double)' here
> c:/MinGW/include/math.h:673: declaration of C function `long double
>   _copysign(long double, long double)' conflicts with
> c:/MinGW/include/math.h:672: previous declaration `float _copysign(float,
>   float)' here
> 
> If I compile it without the include path, the result is this:
> $ g++ geotest.cpp -o ogrTest
> C:\DOCUME~1\Owner\LOCALS~1\Temp/ccWWcaaa.o(.text+0x1f):geotest.cpp:
> undefined re
> ference to `GDALAllRegister'
> 
> So I definately need to add the include path, but do I need to somehow
> override the builtin "math.h"?


Hi Chris,

IMHO this is a MinGW related issue, so I'd ask on the MinGW mailing lists.
If you're not required to use MinGW, I'd strongly recommend to download
and install Visual C++ 2005 Express Edition.
This is free modern C++ compiler and very usable IDE for Windows.

Here you can find mode details and URLs that will help you to get started:

http://mateusz.loskot.net/2006/05/13/building-gdal-and-geos-with-vc-2005-express-edition/

Best regards
-- 
Mateusz Loskot
http://mateusz.loskot.net


More information about the FWTools mailing list