[Gdal-dev] Problem in using the dll in another dll

Mateusz Loskot mateusz at loskot.net
Wed Oct 17 16:09:44 EDT 2007


Tom Kazimiers wrote:
> Hello there,
> 
> I want to use GDAL in a project on windows CE - I was about using it in
> a C++ Dll so thing I have done is:
> *Compiled GDAL for Windows CE
> *Imported the generated .lib into my C++ Windows CE DLL Project
> *Included "gdal_prev.h" via "#include <gdal_priv.h>"
> *Compiled my DLL
> 
> Everything worked fine in Visual Studio 2005 - every Class and Function
> was found.
> As I wanted to use the DLL with my C# Application the Application threw
> an exception which said that it could not find my DLL
> (this is strange as it is in the same folder).
> [...]
> 
> So do you have any suggestion?

Tom,

Check where GDAL DLL was deployed and where is your application.
Usually, VS2005 deploys DLL/EXE files into separate folders,
according to projects ie. \Program Files\project1\my.dll,
\Program Files\project2\my.exe, etc.
You need to manually re-configure deployment settings in your projects
so all binaries go to the same folder.

Second, you need to build PROJ.4 DLL and copy it along with gdal.dll.
proj.dll is loaded dynamically by GDAL (check ogr\ogrct.cpp file).

Third, if you build GDAL with GEOS support, you also need to copy GEOS
DLL files together with gdal.dll and proj.dll.

Generally, tracking dependencies for Windows CE may be tricky.
I configured complete framework as apart of MOSS4G project:
http://trac.osgeo.org/moss4g/
So, perhaps you will find it easier to grab moss4g\libs and checkout
GDAL, GEOS and PROJ.4 into proper sub-directories and then use avaialble
solution (moss4g_libs.sln) and project files.
Everything (projects) is configured and should work out of the box,
you only need to grab sources - get_libs.bat will do it for you.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list