Thanks for the answer. It seems the answer to my question is true, I can use this PInvoke method.
I managed to compile .dylib on Mac and call in C# ConsoleApp in VisualStudio mac by:
C++ Side:
.hpp:
#define PINVOKE extern "C"
PINVOKE int test (int n);
.cpp:
PINVOKE int test (int n){
return n*n;
}
and C#
[DllImport("libsimpleDYLIB.dylib")]
private static extern int test (int n);
I am super suspicious why it is so simple. I did not even had to change anything in default Mac Visual Studio configuration.
@nathanletwory
Is there also a possibility to compile Grasshopper components in Mac Visual Studio?
Or RhinoCommands ? Since it is not a .NET framework
Are there any samples?
Thanks @Dale, I think I will use your documentation since I will get more into Mac development.
I see that you made a tutorial for a Command Line, and do you also have for Grasshopper? Or it is not possible due to .NET?
Both RhinoCommon plug-ins and Grasshopper plug-ins are just .NET assemblies. So the guide (above) should work to build Grasshopper components that call into unmanaged libraries.