Opened 11 years ago

Closed 9 years ago

#5019 closed defect (fixed)

C# Swig build problems

Reported by: andyorionssystems Owned by: tamas
Priority: normal Milestone:
Component: CSharpBindings Version: unspecified
Severity: normal Keywords:
Cc: warmerdam

Description

I ran into trouble following the build guide: http://trac.osgeo.org/gdal/wiki/GdalOgrCsharpCompile

It appears something has changed in the method naming scheme and there were some duplicate method signatures generated.

The below changes fixed the build for me and produced functioning csharp wrappers, felt I should share.

This was built with using swig version 1.3.39 and gdal 1.9.2.

swig\csharp\ogr\OgrPINVOKE.cs line(188):

static OgrPINVOKE() { }

commented out to fix build static OgrPINVOKE() { }

swig\csharp\osr\OsrPINVOKE.cs line(188):

static OsrPINVOKE() { }

commented out to fix build errror static OsrPINVOKE() { }

swig\csharp\gdal\GdalPINVOKE.cs line(188):

static GdalPINVOKE() { }

commented out to fix build static GdalPINVOKE{ }

swig\csharp\Driver.cs line(17):

changed GdalPINVOKE.DriverUpcast to match GdalPINVOKE.Driver_SWIGUpcast public Driver(IntPtr cPtr, bool cMemoryOwn, object parent) : base(GdalPINVOKE.Driver_SWIGUpcast(cPtr), cMemoryOwn, parent)

swig\csharp\gdal\Dataset.cs line(17):

changed GdalPINVOKE.DriverUpcast to GdalPINVOKE.Driver_SWIGUpcast public Driver(IntPtr cPtr, bool cMemoryOwn, object parent) : base(GdalPINVOKE.Driver_SWIGUpcast(cPtr), cMemoryOwn, parent) {

swig\csharp\gdal\Band.cs line(17):

change GdalPINVOKE.BandUpcast to GdalPINVOKE.Band_SWIGUpcast public Band(IntPtr cPtr, bool cMemoryOwn, object parent) : base(GdalPINVOKE.Band_SWIGUpcast(cPtr), cMemoryOwn, parent) {

Attachments (1)

gdal-1.9.2-swig-csharp.zip (959.5 KB ) - added by andyorionssystems 11 years ago.
as requested this is a zip of gdal-1.9.2/swig/csharp, after my modifications to the files specified in the ticket to fix my build

Download all attachments as: .zip

Change History (7)

comment:1 by warmerdam, 11 years ago

Cc: warmerdam added
Component: defaultCSharpBindings
Owner: changed from warmerdam to tamas

Tamas - any thoughts?

comment:2 by tamas, 11 years ago

According to the recent builds of http://www.gisinternals.com/sdk/ I don't see any issues with compiling the C# bindings. Could you provide your entire build output and the generated c# files?

by andyorionssystems, 11 years ago

Attachment: gdal-1.9.2-swig-csharp.zip added

as requested this is a zip of gdal-1.9.2/swig/csharp, after my modifications to the files specified in the ticket to fix my build

comment:3 by andyorionssystems, 11 years ago

Not sure if the build doesn't support Windows 8 x64, but my build error I reported seems to only occur on that operating system. I just followed the directions once again on a Win 7 machine and did not run into the same problem.

Versions: gdal 1.9.2 swig 1.3.39 Windows 8 x64 Pro Visual Studio 2012 Pro

in reply to:  3 comment:4 by tamas, 11 years ago

Replying to andyorionssystems:

Not sure if the build doesn't support Windows 8 x64, but my build error I reported seems to only occur on that operating system. I just followed the directions once again on a Win 7 machine and did not run into the same problem.

Versions: gdal 1.9.2 swig 1.3.39 Windows 8 x64 Pro Visual Studio 2012 Pro

I guess we cannot compile the bindings for VS2012 at the moment. You might want to try compiling against .NET Framework 4.0 or earlier.

comment:5 by Jukka Rahkonen, 9 years ago

File from http://download.gisinternals.com/query.html?content=filelist&file=release-1700-x64-gdal-mapserver.zip is said to be compiled with MSVC 2012 (x64) and contains csharp directory with good looking files.

Does this mean that "C# Swig build problems" have been solved and this ticket can be closed as fixed?

comment:6 by Even Rouault, 9 years ago

Resolution: fixed
Status: newclosed

Assuming this is fixed

Note: See TracTickets for help on using tickets.