[gdal-dev] Re: GDALAllRegister()

Jorge Arévalo jorge.arevalo at deimos-space.com
Mon Feb 7 06:23:58 EST 2011


On Mon, Feb 7, 2011 at 12:18 PM, alejandra rodriguez <alexrl7 at gmail.com> wrote:
>
>>>> Hello,
>>>>
>>>> I am starting using GDAL, I have downloaded the libraries and I'm trying
>>>> to use them in my code, but when I try with the GDALAllRegister() function
>>>> an error appears. I only have written this code:
>>>>
>>>> #include <iostream>
>>>>
>>>> using namespace std;
>>>>
>>>> #include "gdal_priv.h"
>>>>
>>>> #include "cpl_conv.h" // for CPLMalloc()
>>>>
>>>> int main()
>>>>
>>>> {
>>>>
>>>> GDALDataset *poDataset;
>>>>
>>>> GDALAllRegister();
>>>>
>>>> char *pszFilename
>>>>
>>>> pszFilename = "201010131445_VIS_006_GEO_EUR_16bpp.XPIF";
>>>>
>>>> poDataset = (GDALDataset *) GDALOpen( pszFilename, GA_ReadOnly );
>>>>
>>>> if( poDataset == NULL )
>>>>
>>>> {
>>>>
>>>> cout << "poDataset is null" << endl; // prints
>>>>
>>>> return 0;
>>>>
>>>> }
>>>>
>>>> }
>>>>
>>>> and I get this error:
>>>>
>>>> undefined reference to `GDALAllRegister'
>>>>
>>>> collect2: ld returned 1 exit status
>>>>
>>>> make: *** [gdal] Error 1
>>>>
>>>> Do you know what I have to do to make it work?
>>>>
>>>> Thank you and regards,
>>>>
>>>> Alex
>>>
>>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>

Hello,

Seems you're not linking with GDAL libraries. How do you compile and
link the code? gcc, Visual Studio? We need more info.

Best regards,

-- 
Jorge Arévalo
Internet & Mobilty Division, DEIMOS
jorge.arevalo at deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g


More information about the gdal-dev mailing list