Cant find GDALRegisterMe

Topics: General Topics, SharpMap v0.9 / v1.x
Jul 9, 2010 at 8:39 PM
Hi, I'm trying to use the GDALRasterLayer but get the following exception when trying to create a layer: "An unhandled exception of type 'System.ApplicationException' occurred in gdal_csharp.dll Additional information: Can't find requested entry point: GDALRegisterMe" I'm using the 0.9 version of SharpMap along with the 2.4.2 version of GDAL. I've copied the GDAL csharp bindings along with all the other GDAL DLLs into my applications exe folder. Any help with this would be greatly appreciated.
Jul 10, 2010 at 9:31 PM

Could you provide full stack trace please?

If you use current version from trunk,  compile that yourself , as it is suggested, then sharpmap is build with bindings to gdal 2.4.7 as of rev 71611. I don't know if that is a problem or not.

cheers FObermaier

Jul 11, 2010 at 6:37 PM
Edited Jul 11, 2010 at 6:48 PM

Thanks for responding, call stack is:

Gdal_csharp.dll!OSGeo.GDAL.Gdal.AllRegister() + 0x39 bytes
SharpMap.Extensions.dll!SharpMap.Layers.GdalRasterLayer.GdalRasterLayer(string strLayerName = "My layer", string imageFilename = "C:\\Program Files\\FWTools2.4.2\\demo-data\\utm.tif") Line 393 + 0x6 bytes > mapping1.exe!mapping1.Form1.Form1() Line 25 + 0x21 bytes
mapping1.exe!mapping1.Program.Main() Line 18 + 0x15 bytes
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) + 0x3a bytes
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() + 0x2b bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x66 bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6f bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes

I've tried removing the references to gdal_csharp from the build and replacing it with my local copy (verison 2.4.7) but get the same result.

Jul 12, 2010 at 8:28 AM
Edited Jul 12, 2010 at 8:38 AM

Hello bonsey,

I cannot reproduce your problem on my machine.

Have you set your [app|web].config according to this (you might need to change 2.4.2 to 2.4.7). If you do that, you shouldn't need to copy your native libraries to the app folder. Perhaps you mixed some things?


Hth FObermaier

Jul 12, 2010 at 1:02 PM
Edited Jul 12, 2010 at 1:03 PM
Hi FObermaier,
Tried that with no luck, including unpacking all the files to make sure there were no mix ups. I'm referencing gdal_csharp @ Trunk\ExternalReferences\References4SharpMap.Extensions\gdal_csharp.dll, is this correct?
Do you know which GDAL dll the function GDALRegisterMe should be in so I can make sure I have the file?
Thanks again for your help with this.
Jul 12, 2010 at 1:21 PM

Hello Bonsey, could you post  your [app|web].config file along with the output of

cmd set > set.txt
thanks Fobermaier

Jul 13, 2010 at 7:17 AM
Edited Jul 13, 2010 at 7:19 AM

Hi Fobermaier

It would appear I had the same idea as you,  so I installed everything on a clean machine and it works fine.   My other machine has an application which also uses GDAL (an older version) and had added some environment variables which were obviously upsetting things.    This may be an issue in the future but for now I can at least get around it.