[Mono-osx] Problem building and using a Cocoa .dylib

tlapse tlapse at gmail.com
Mon Feb 6 18:51:20 UTC 2012


Ok, I tried a simple c++ library and I get the same error.

[DllImport("liblibqlrtx.dylib", EntryPoint = "myreverse", SetLastError =
true, CallingConvention = CallingConvention.Cdecl)]
static extern int myreverse([MarshalAs(UnmanagedType.LPArray)] byte[] key);

"System.EntryPointNotFoundException:"


---- the .h file
#ifndef libqlrtx_libqlrtx_h
#define libqlrtx_libqlrtx_h

extern "C" void myreverse(char s[]);

#endif

---- the .cpp file
#include <iostream>

/* reverse:  reverse string s in place */
void myreverse(char s[])
{
    int i, j;
    char c;
	
    for (i = 0, j = strlen(s)-1; i<j; i++, j--) {
        c = s[i];
        s[i] = s[j];
        s[j] = c;
    }
}

--
View this message in context: http://mono.1490590.n4.nabble.com/Problem-building-and-using-a-Cocoa-dylib-tp4341716p4362348.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list