[gdal-dev] Strange error on gdalAllRegister()

Even Rouault even.rouault at mines-paris.org
Fri Jul 1 17:02:49 EDT 2011


Le vendredi 01 juillet 2011 22:29:45, Rodolfo Bonnin a écrit :
> Hello All,
> 
> I'm writing two new drivers ( For ALOS PRISM and AVNIR-2 ) and I'm trying
> to add them to the list of drivers.
> 
> I've added them to gdal_frmts.h:
> 
> void CPL_DLL GDALRegister_PRISM(void)
> void CPL_DLL GDALRegister_AVNIR2(void)
> 
> And provisionally, I've added them to gdalallregister.cpp, joining them to
> the jaxapalsar driver, which I'm sure I'm including
> 
>  #ifdef FRMT_jaxapalsar
> 
>     GDALRegister_AVNIR2();
>     GDALRegister_PRISM();
>     GDALRegister_PALSARJaxa();
> 
> #endif
> 
> But I've no way of gdalallregister.cpp to see the declaration of the
> functions of these drivers.
> 
> 
> gdalallregister.cpp: In function 'void GDALAllRegister()':
> gdalallregister.cpp:483: error: 'GDALRegister_AVNIR2' was not declared in
> this scope
> gdalallregister.cpp:484: error: 'GDALRegister_PRISM' was not declared in
> this scope
> 
> 
> BTW, I', using a CMake script to compile, but the library compiles just
> fine with jaxapalsar support, if I delete the references to the new file
> formats, and at the point of compilation this bug triggers, the only
> requirement is that the GDALRegister functions have to be declared, and
> the gdal_frmts.h file is available.

Are you sure that your .cpp files is really including the gdal_frmts.h you've 
edited and not another one that might lie in a system directory somewhere ? 
I'd check the -I flag of g++ to see if it doesn't include another directory. 
And/or g++ -E to see the preprocessed output.

> 
> Many thanks in advance.


More information about the gdal-dev mailing list