I have an application that uses a third party DLL. Is there a way in Visual Studio for Mac to write an application to access it the same way as I can on windows?
It depends:
If you have C/C++ code you should be able to build it for OSX (with GCC for example) if it doesn't have some foreign (Windows) platform specific code. Then you can use the compiled *.so / *.dylib file directly. But you'll need to tell the .NET Runtime (Mono for example on OSX) to use the different file using a DllMap configuration file (see http://www.mono-project.com/docs/advanced/pinvoke/dllmap/ for examples).
The sources you've linked look like they're for Unix, so the chance to be able to build them on OSX are pretty good (there's a Makefile and the resulting binary would be libswe.so on Unix). You could try to pass the -dynamiclib
parameter to GCC to get a OSX specific libswe.dylib (What are the differences between .so and .dylib on osx? seems to be a good answer about dylib)
If you have the binary of your DLL for OSX, you just need a configuration file for your .NET application, which could look like this:
<configuration>
<dllmap os="osx" dll="libswe.dll" target="libswe.dylib"/>
<configuration/>
It tells the .NET Runtime to import the symbols from libswe.dylib
instead of libswe.dll
if the current OS is OSX.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With