Hi Helmut,
I"ve done some testing and it turns out that this is not a nant problem. Running the followiong code:
I use nant rc1 on Windows XP.
I want to use wrapped functions out of a gcc-generated dll,
but detected following problem:
A function defined via task script doesn't return
when calling a function from a dll created by gcc.
using System;
using System.Runtime.InteropServices; class Class1
{
[DllImport("test.dll",
EntryPoint="dll_fct",ExactSpelling=true,
CharSet=CharSet.Ansi,
CallingConvention=CallingConvention.StdCall
)]
private static extern string dll_fct(string par);
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args) {
string result = dll_fct("sdsdsds");
}
}as a console executable results in the application hanging. ( when using the gcc built dll ).
I had a look at the two dlls with depends and they look pretty much the same - although the gcc one has a dependency on cygwin.dll. My suspician is that there is some issue with the cygwin runtime that causes it to misbehave when called with P/Invoke. You could try reporting it to the cygwin maintainers or perhaps try one of the other gcc distros for windows - like mingw:
http://www.mingw.org/download.shtml
Ian
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Nant-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nant-users
