View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013814CMakeCMakepublic2012-12-26 11:512014-06-02 08:37
ReporterMatt Williams 
Assigned Tojschueller 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformGCC 4.7OSopenSUSE LinuxOS Version12.2
Product VersionCMake 2.8.10.2 
Target VersionFixed in VersionCMake 3.0 
Summary0013814: SWIG C# generates a DllImport line that doesn't match the library name
DescriptionWhen creating C# bindings with UseSWIG like:

  swig_add_module(MyModuleCSharp csharp MyModule.i)

then SWIG will generate code containing

  [DllImport("MyModule", EntryPoint="...")]

but the library name generated by CMake will be something like libMyModuleCSharp.so (note the 'CSharp' suffix). This causes the generated bindings to crash unless the library and module names just happen to match.

SWIG provides an argument to set the DllImport name to something else. By passing "-dllimport MyModuleCSharp" the DllImport line will contain the correct library name.

  [DllImport("MyModuleCSharp", EntryPoint="...")]

Attached is a patch which implements this inside SWIG_MODULE_INITIALIZE.
TagsNo tags attached.
Attached Filespatch file icon swig_csharp_dllimport.patch [^] (1,110 bytes) 2012-12-26 11:51 [Show Content]

 Relationships

  Notes
(0034549)
jschueller (developer)
2013-11-25 09:17

http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=acc59e55e12c1979735ba42569411892e215afba [^]
(0036030)
Robert Maynard (manager)
2014-06-02 08:37

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-12-26 11:51 Matt Williams New Issue
2012-12-26 11:51 Matt Williams File Added: swig_csharp_dllimport.patch
2013-11-25 08:25 Brad King Assigned To => jschueller
2013-11-25 08:25 Brad King Status new => assigned
2013-11-25 09:17 jschueller Note Added: 0034549
2013-11-25 09:17 jschueller Status assigned => resolved
2013-11-25 09:17 jschueller Fixed in Version => CMake 3.0
2013-11-25 09:17 jschueller Resolution open => fixed
2014-06-02 08:37 Robert Maynard Note Added: 0036030
2014-06-02 08:37 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team