From: MARTIN P. <hic...@gm...> - 2012-04-18 16:16:42
|
> Nope, as long as it is in C++, there is no guarantees that it will work > with a different compiler. What you could do is to thunk the code via a > C bridge from the MSVC side. > eg for Simple C++: > rettype C_Shutdown(unsigned long a){ > return Shutdown(a); > } > and for class/members > rettype C_ClassName_MemberFunt(void *C_this, arg1, arg2, ...){ > ClassName _this = (ClassName)C_this; > return _this->MemberFunt(arg1,arg2,..); > } > and so on. It gets more complicated with virtual/pure functions, you'll > need to build a pseudo vtable etc. It won't. The API exported by their DLL isn't even object. It looks like pure C calls, there are no classes at all. i have no idea why they didn't export it "extern C" at the first place. > Once you have all the thunk code, compile and link it with MSVC into a > DLL, you can now use the DLL from mingw-w64 and gendef. Okay. i have asked the library vendors if they would do that (i won't do it myself, because their API might be subject to changes, and i'm not going to do that each time they release). As they are already developping on Windows with MSVC, it should be a no-brainer for them. Thanks for the tip JonY :) Pierre. |