I have an msvc dll that has some functions that I want to call with go. I understand that it's not going to be reasonable to wrap all of the functionality of a large project, but I only need a subset of functionality and the time spent on wrapping the c++ with SWIG is reasonable for me.
The potential issue that I've discovered is that the c++ ABI is not compatible between mingw/gcc and msvc, so if I compile the generated wrapper with gcc as specified in the SWIG documentation, it probably won't be able to call the functions in the DLL.
The first question is whether this understanding is correct.
The second question is that assuming the above is true, my plan is to "cdecl(dllexport)" all of the "externs" in the swig wrapper and then "cdecl(dllimport)" all of the "externs" in the cgo section in the generated go file, then compile the DLL with msvc.
My preference, however, would be to compile the object file with msvc and then rename it to .syso so that the go linker will automatically pick it up.
The second question is whether either of these two options are reasonable and/or likely to be successful.
Thanks in advance.