I have a bunch of methods like this:
int add5(int val)
{
return add5Wrap(val);
}
int instanceMethod(void)
{
return instanceMethodWrap();
}
int classMethod(void)
{
return classMethodWrap();
}
void getPropertyString(char * outStr)
{
outStr = getProperty();
}
void setPropertyString(char * string)
{
setProperty(string);
}
int start(void)
{
initialise();
return 0;
}
And they're declared in a header like this:
int add5(int val);
int instanceMethod(void);
int classMethod(void);
void getPropertyString(char * string);
void setPropertyString(char * string);
int start(void);
And they're compiled together with some objective-C that they interact with into a dylib.
The dylib loads. All the methods run without whining* as far as I can tell, except one.
start() does not run. It gives an EntryPointNotFoundException.
What could be causing this and how can I fix it?
*They still give wrong values because nothing is initialised though.
C# side:
[DllImport("mydll.dylib")]
public static extern int start ();
[DllImport("mydll.dylib")]
public static extern int add5 (int val);
[DllImport("mydll.dylib")]
public static extern int instanceMethod();
[DllImport("mydll.dylib")]
public static extern int classMethod();
start();
add5(5);
etc.
I found out the answer. I had assumed that the folder MonoMac was looking for the dylib was /Library/Frameworks. In reality it was looking in /usr/lib. The version of the library in /usr/lib was much older than the one in /Library/Frameworks.