dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] segfault with PInvoke on amd64 (x86-64)


From: Stefan Kluehspies
Subject: [Pnet-developers] segfault with PInvoke on amd64 (x86-64)
Date: Wed, 30 Mar 2005 11:16:42 +0200

Hi all,
I have written a C++ Library, that is mapped with SWIG to C#. I have
tested all on win32, and everything works.
On my other box I have Gentoo AMD64 running, using pnet to test the
program. Now I get a segfault whenever my C# program calls a method in
my C++ object, that returns a char* or std::string. There are no
problems calling functions that return just e.g. double values.
Here is some small example:

class my_class
{
public:
  double get_value();
  const char* get_text();
};

For this class SWIG generates a wrapper object in C#, that calls the c++
method via PInvoke.
In my test program 

class test_program
{
  public static void Main()
  {
     my_class c = new my_class;
     ConsoleWriteLine(c.get_value());
  }
}
works just fine, but 
     ConsoleWriteLine(c.get_text());
segfaults.

Do you have any hint how to solve this? Or how to find the bug?
Thanks in advane,
Stefan
-- 
  Stefan Kluehspies
  address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]