开发者

In a Visual Studio C++ project with /clr, are its dependencies also compiled to managed code?

开发者 https://www.devze.com 2022-12-29 23:44 出处:网络
To be a bit more clear. If I have a Visual Studio C++ solution that has two projects, say a static library with CLR support turned off, and a second project with CLR support turned on that depends on

To be a bit more clear. If I have a Visual Studio C++ solution that has two projects, say a static library with CLR support turned off, and a second project with CLR support turned on that depends on this static library, does the static library get compiled as managed code? What about libraries that the CLR project uses that are开发者_JAVA技巧 external to this solution, do they also get compiled as managed code?


No, only the project with /clr gets compiled to a managed assembly. The static library will get compiled as unmanaged code and linked into the managed DLL.


No, your dependencies do not get compiled as managed code.

Your "main" project actually ends up containing both managed and unmanaged code. Those parts when you call your dependency would be compiled as unmanaged.

0

精彩评论

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

关注公众号