[gdal-dev] Re: Runtime error on executing "OGRRegisterAll()"
function.
mrym
meryemvrl at gmail.com
Thu Dec 15 10:33:02 EST 2011
Here is my command line:
/Od /I "E:\BELGIS\gdal-1.7.2\libecwj2-3.3\Source\include" /I
"C:\mrym\warmerda\bld\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D
"_USRDLL" /D "BELGDAL_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /Gm
/EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /Gd /TP
/errorReport:prompt
*Here is my test code:*
#include <iostream>
#include <windows.h>
#include <tchar.h>
typedef void (*ProjectPointCall)();
int main(){
set_PGdal_ProjType_In _set_PGdal_ProjType_In;
set_PGdal_ProjType_Out _set_PGdal_ProjType_Out;
ProjectPointCall _ProjectPointCall;
HINSTANCE hInstLibrary = LoadLibrary(_T("belGdal.dll"));
if (hInstLibrary){
_ProjectPointCall=(ProjectPointCall)GetProcAddress(hInstLibrary,
"ProjectPointCall");
_ProjectPointCall();
FreeLibrary(hInstLibrary);
}
else{
std::cout << "DLL Failed To Load!" << std::endl;
}
return 0;
}
*This is _ProjectPointCall():*
void __cdecl ProjectPointCall(){
double *aXOut= new double;
double *aYOut= new double;
Gdal_ProjectPoint( 0.0, 0.0, p_ProjType_In, p_ProjType_Out, aXOut,
aYOut );
}
*p_ProjType_In, p_ProjType_Out are static variables.
This is Gdal_ProjectPoint function:*
bool __stdcall Gdal_ProjectPoint(double aXIn, double aYIn, const
PGdal_ProjType aProjIn, const
PGdal_ProjType aProjOut, double* aXOut, double* aYOut ){
bool changeProjSrc, changeProjDest;
int datumCount = g_EPSGDatums.GetSize();
GDALAllRegister();
if(datumCount == 0)
SetupEPSGDatums();
....
}
When i debug it i get error at GDALAllRegister(). I've tried debugging
other functions in my dll and all gdal function calls gave me the same
error.
And i have changed flags and built it in this way
nmake -f makefile.vc clean
nmake -f makefile.vc MSVC_VER=1500 DEBUG=1
nmake /f makefile.vc install
nmake /f makefile.vc devinstall
Thanks a lot..
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Runtime-error-on-executing-OGRRegisterAll-function-tp4453903p7097491.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
More information about the gdal-dev
mailing list