R: [Gdal-dev] how to link gdal to my programs?

Amici Alessandro alessandro_amici at telespazio.it
Wed Jan 14 03:22:34 EST 2004


Pushkar,

> I'm having a little trouble linking gdal libs. to my C++ code.
> These are the compile errors:
> Redstone[1234] pushkar$ g++ -g -o main
> dwt-serial.cpp -Ierrs/ -Imisc/ -Iip/ -I../gdal-1.1.9/include/
> dwt-serial.cpp: In function `int main(int, char **)':
> dwt-serial.cpp:20: `GDALDataset' undeclared (first use this function)
> dwt-serial.cpp:20: (Each undeclared identifier is reported only once
> dwt-serial.cpp:20: for each function it appears in.)
> dwt-serial.cpp:20: `poDataset' undeclared (first use this function)
> dwt-serial.cpp:26: parse error before `)'
> 
> I tried -lgdal.1.1, -lgdal.1.1.9 but neither worked. I've set the path to
> GDAL (/rstc/user1/erc/pushkar/gdal-1.1.9/lib) in my $LD_LIBRARY_PATH

the error you show looks like a compile error (not a link one).
you should probably play with the -I option, i.e. try to set the absolute 
path instead of ../gdal-1.1.9/include.

cheers,
alessandro



More information about the Gdal-dev mailing list