Not able to run SWIG C# examples in VS 2010

后端 未结 3 844
借酒劲吻你
借酒劲吻你 2021-01-06 20:40

I am trying to get SWIG to work with Visual Studio and C#.

I downloaded swigwin-2.0.4.zip and converted the project to a VS 2010 project.

I am able to build

3条回答
  •  无人及你
    2021-01-06 21:40

    I got the following answer from Gregory Bronner on the swig-user mailinglist:

        I had this issue as well (VS2010 , Windows 7, 64 bit computer, 32 bit mode dll, .NET 4) :
    
        The problem actually relates to being unable to load the DLLs
    
        There were two causes:
    
        #1:  All DLLs used by the C# assembly need to be in the same directory (or you need to change the lookup paths).
    
    
        #2: The C# or the C++ DLL (I forget which) had incorrect CofFlags -- use CorFlags  /32Bit+ *.dll or something like that.  You could also try using /UpgradeCLRHeader
    
    
        #3: You need to target the .NET 4.0 system in the project file, but 1 and 2 should get you started.
    

    I will try these hints out and see whether they work and then post an answer if I am able to resolve the issue.

提交回复
热议问题