Hi,
For a small project of mine I tried to link your library to a C# project. This failed due to the fact that your library is unmanaged, so I tried creating a C++/CLR wrapper to do this, but I kept failing. Now isn't C++/CLR really in my comfort zone and even though I created a .lib file out of your .def file the compiler didn't seem to pick up the .dll itself and I have no clue how to do it.
Does anyone have any experience in linking C++/CLR to this libdivecomputer? Or even better, with C#?
Kind regards, Vincent
On 28-02-17 22:21, Vincent Hagen wrote:
For a small project of mine I tried to link your library to a C# project. This failed due to the fact that your library is unmanaged, so I tried creating a C++/CLR wrapper to do this, but I kept failing. Now isn't C++/CLR really in my comfort zone and even though I created a .lib file out of your .def file the compiler didn't seem to pick up the .dll itself and I have no clue how to do it.
Does anyone have any experience in linking C++/CLR to this libdivecomputer? Or even better, with C#?
You can certainly use libdivecomputer from C#. But instead of trying to link the C code into your application, you can simply call the native functions from the library (build as dll) using P/Invoke.
I've attached some minimal example code. I never had time to finish it, but I think there should be enough to get you started.
Jef