[gdal-dev] strange problem with compilation

Martin Landa landa.martin at gmail.com
Mon Oct 13 04:33:11 PDT 2014


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  -lgdal main.cpp

Error:

undefined reference to GDALAllRegister

We checked that the library is in the path (libc.conf, updated  by
`ldconfig` ) and contains GDALAllRegister() (checked by `nm`).

OS: Ubuntu 14.04LTS (64bit).

Any idea what could be wrong? Thanks in advance, Martin

-- 
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa


More information about the gdal-dev mailing list