Re: [gdal-dev] strange problem with compilation

2014-10-13 Thread Even Rouault
On Monday 13 October 2014 13:41:11 Martin Landa wrote: > Hi, > > 2014-10-13 13:33 GMT+02:00 Martin Landa : > > g++ -I /usr/local/include -L /usr/local/lib -lgdal main.cpp > > > > Error: > > > > undefined reference to GDALAllRegister > > solved, > > g++ mail.cpp -I /usr/local/include -L /usr/l

Re: [gdal-dev] strange problem with compilation

2014-10-13 Thread Martin Landa
Hi, 2014-10-13 13:33 GMT+02:00 Martin Landa : > g++ -I /usr/local/include -L /usr/local/lib -lgdal main.cpp > > Error: > > undefined reference to GDALAllRegister solved, g++ mail.cpp -I /usr/local/include -L /usr/local/lib -lgdal works (so `-l` after cpp file). Strangely g++ 4.7 works on both

[gdal-dev] strange problem with compilation

2014-10-13 Thread Martin Landa
Hi all, we are facing to a strange problem when trying to compile C++ code against GDAL library. We have a self-compiled GDAL located in `/usr/local/lib`. Sample code: """ #include "ogrsf_frmts.h" int main() { GDALAllRegister(); } """ Command: g++ -I /usr/local/include -L /usr/local/lib -