[Gdal-dev] Programming with GDAL in Windows XP using DEV-C++ or CodeBlocks

btaylor bryanmtaylor13 at charter.net
Wed Sep 23 01:59:11 EDT 2009

I've been trying to use/build GDAL in Windows.  I thought I'd start with the 
perry-geo hillshade, aspect, and slope command line utilities and then move 
into building some custom raster calculators/manipulation utilities. 
However, after spending many hours across several days attempting to compile 
these files under WinXP, and searching hundreds of internet links, I am 
unable to successfully link to the gdal libraries and have a successful 
compile.  I have tried to use pre-compiled gdal libraries and headers and 
also I have tried to compile from source myself.  Lately I have installed 
CodeBlocks in an attempt to circumvent DEV-C++ in case there were problems 
with the compiler gui.  Again, no success, but I do get the same reference 
errors as in DEV-C++ when the linker starts (see below). 
Has anyone used GDAL libraries in a windows compiling environment?  I am so 
tired of experimenting.  I would really like to know if someone has done 
this or can do this, and specifically, how they pulled it off.  Any help 
would be appreciated.  I've dabbled in programming, but my biggest weakness 
is understanding the compiling/linking process and makefiles and such.  If 
anyone can help or point me in the right direction I'd be grateful.  Thanks, 
Compiler log: 
-------------- Build: Debug in Hillshade --------------- 
Compiling: main.cpp 
In file included from 
                 from C:/gdalwin32exe141/gdalwin32-1.4.1/include/gdal.h:40, 
                 from C:\Hillshade\Hillshade\main.cpp:27: 
C:/gdalwin32exe141/gdalwin32-1.4.1/include/cpl_config.h:89: warning: 
ignoring #pragma warning 
Linking console executable: bin\Debug\Hillshade.exe 
obj\Debug\main.o: In function `main': 
C:/Hillshade/Hillshade/main.cpp:85: undefined reference to 
C:/Hillshade/Hillshade/main.cpp:90: undefined reference to `_GDALOpen' 
C:/Hillshade/Hillshade/main.cpp:97: undefined reference to 
C:/Hillshade/Hillshade/main.cpp:107: undefined reference to 
C:/Hillshade/Hillshade/main.cpp:108: undefined reference to 
C:/Hillshade/Hillshade/main.cpp:116: undefined reference to 
`GDALDriverManager::GetDriverByName(char const*)' 
C:/Hillshade/Hillshade/main.cpp:121: undefined reference to 
`GDALDriver::Create(char const*, int, int, int, GDALDataType, char**)' 
C:/Hillshade/Hillshade/main.cpp:125: undefined reference to 
C:/Hillshade/Hillshade/main.cpp:151: undefined reference to 
`GDALRasterBand::RasterIO(GDALRWFlag, int, int, int, int, void*, int, int, 
GDALDataType, int, int)' 
C:/Hillshade/Hillshade/main.cpp:206: undefined reference to 
`GDALRasterBand::RasterIO(GDALRWFlag, int, int, int, int, void*, int, int, 
GDALDataType, int, int)' 
collect2: ld returned 1 exit status 
Process terminated with status 1 (0 minutes, 0 seconds) 
10 errors, 1 warnings 

View this message in context: http://n2.nabble.com/Programming-with-GDAL-in-Windows-XP-using-DEV-C-or-CodeBlocks-tp3697752p3697752.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.

More information about the gdal-dev mailing list