[Gdal-dev] Re: Problem using EPSG in C#

Tomas R monshi at home.se
Thu May 10 09:24:43 EDT 2007


I thought  I had the issue solved, that I had managed to compile the 
correct C# bindings and so on.

But, sadly no.
What have I got?
FWtools 3.0
Gdal source, from the latest Trunk
Got the whole SDK-kit from MS, Swig 1.3.31 and Visual Studio Express C++

I manage to compile the whole GDAL-project. I manage to compile C# 
bindings with CSHARP_STATIC_LINKAGE = YES and CSHARP_STATIC_LINKAGE = NO 
but NOT with it commented out.
The compile with CSHARP_STATIC_LINKAGE = NO do not seem to affect the 
result as would be needed. When I try to set up a SpatialReference with 
an EPSG-code I still get a 6.

With CSHARP_STATIC_LINKAGE  commented out the compilation halts when 
creating gdal_wrap.dll:
> LINK : gdal_wrap.dll not found or not built by the last incremental link; perfor
> ming full link
>    Creating library gdal_wrap.lib and object gdal_wrap.exp
> gdal_wrap.obj : error LNK2019: unresolved external symbol _GDALIdentifyDriver at 8
> referenced in function "void * __cdecl IdentifyDriver(char const *,char * *)" (?
> IdentifyDriver@@YAPAXPBDPAPAD at Z)
> gdal_wrap.dll : fatal error LNK1120: 1 unresolved externals
> NMAKE : fatal error U1077: '"C:\Program\Microsoft Visual Studio 8\VC\BIN\link.EX
> E"' : return code '0x460'
> Stop.

Why is it never as simple? Do I miss something?

/Tomas


Tamas Szekeres skrev:
> Tomas,
> 
> You'll have to comment out the
> CSHARP_STATIC_LINKAGE = YES
> in csharp.opt and recompile the C# interface. Using this setting the
> csharp dll-s will link against the gdal14.dll so the
> PushFinderLocation and ImportFromEPSG will operate on the same global
> data. In the future I consider to use this setting as the default
> option.
> 
> BTW: I would propose to use the latest development version of the C#
> related stuff. There were some fundamental changes in the interface
> that might cause some changes in the existing code. For more
> information see:
> http://trac.osgeo.org/gdal/wiki/GdalOgrCsharpVersions
> 
> You might also use the binaries of the latest FWTools
> http://test.gdal.org/fwtools/FWTools130.exe
> and replace the *_wrap.dll-s and *_csharp.dll-s inside with the
> compiled version.
> 
> Best regards,
> 
> Tamas
> 
> 
> 




More information about the Gdal-dev mailing list