I have a project in which I need to make a Visual C++ wrapper for a native C++ SDK, so that it can eventually be used in C#.
The SDK consists of .h files that I am correctly including (no compilation errors with these) and some .lib files which need to be referenced. And that seems to be the tricky part.
As I explained in this question, I get errors whenever I try to call a function that's part of the library. The errors look like this:
error LNK2080: unresolved token (0A000027) "public: static class vhtIOConn *__clrcall vhtIOConn::getDefault(enum vhtICRConn::DeviceType)"
error LNK2019: unresolved external symbol "public: static class vhtIOConn * __clrcall vhtIOConn::getDefault(enum vhtIOConn::DeviceType)"
As I understand, C++/CLR expects __clrdecl
while native C++ offers __clrcall
.
What is the proper way to go about this? I have read in many places that this is possible, but I haven't seen any practical working examples. Note that I am using Visual Studio 2010.