How to use a Visual Studio static library from mingw-w64?

北战南征 提交于 2020-01-14 06:00:11

问题


The title is pretty self explanatory: I need to call functions (they are extern "C" so no mangling) in a Visual Studio 2019 .lib file from a mingw-w64 .exe; I have the source code for both. The reason is that I'm writing a 3D game with 2 renderers: OpenGL and Direct3D 11, and the core code and the OpenGL renderer are compiled with mingw-w64, but the D3D11 part is compiled with VS. How to interoperate between them? Can I merge both renderers into one .a (mingw-w64) static library or one .dll and call it from mingw-w64, or should I make a separate .dll for D3D and use its functions as needed?


Also see this question about a way to avoid data races across std implementations. I decided to link it because both questions are about the same program that I'm writing.

来源:https://stackoverflow.com/questions/56727833/how-to-use-a-visual-studio-static-library-from-mingw-w64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!