[gdal-dev] Runtime error on executing "OGRRegisterAll()" function.

Mateusz Loskot mateusz at loskot.net
Tue Jan 26 07:33:44 EST 2010


vadi_nabble wrote:
> Hi, I have build "gdal1.6.3" solution under VC++ 2008 Pro. Edition,
> and using its "gdal.lib" file for one another application.
> 
> In the other Application, I am using OGR APIs "OGRRegisterAll". I am
> able to build the application but on executing the program i am
> getting a Run Time errror "Unhandled exception at 0x10264e35
> (msvcr90d.dll) in OGR_API_Tutorial.exe: 0xC0000005: Access violation
> reading location 0x6973762f."
> 
> On debugging, what I found is, something is going wrong when 
> VSIInstallGZipFileHandler() function gets called.
> 
> I think, I am missing some of the setting in nmake.opt file or some 
> configuration. Also I don't know how to enable HAVE_LIBZ macro.

You are suffering of a well-known problem.
I documented it recently in the Trac ticket:

http://trac.osgeo.org/gdal/ticket/3346

GDAL debug build links against non-debug Microsoft C/C++ Run-time
libraries - /MD flag is forced in nmake.opt. However, when you make
debug build of your application, by default your project links against
debug version (see in error msvcr90d.dll)

I fix this problem myself by configuring GDAL debug build to use
/MDd flags - I replace /MD with /MDd in nmake.opt.


Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list