开发者

Wrap VC++ Static Library in a DLL to use with .Net Managed Assemblies

开发者 https://www.devze.com 2023-01-23 07:40 出处:网络
I have some source that can compile with MINGW gcc or with VC++ (but isn\'t in a VS project, it has a makefile that is read by nmake). I compile with nmake and it produces a static lib and I would lik

I have some source that can compile with MINGW gcc or with VC++ (but isn't in a VS project, it has a makefile that is read by nmake). I compile with nmake and it produces a static lib and I would like to compile the code as a DLL to use with my managed assemblies.

Is it trivial to alter the makefile to output a DLL instead of th开发者_如何学Ce static? Or do I need to somehow wrap the static lib in a DLL? I apologize because I'm sure this has been answered before but I've never had to do this before and not sure where to start reading. I'm not finding what I think I need on SO either, even though it's most likely asked/answered already.


A wrapper is probably the way to go here. You'd create a Managed C++ DLL which links to the static lib. Then you could call the Managed C++ DLL from other managed assemblies.

0

精彩评论

暂无评论...
验证码 换一张
取 消