c运行时不可思议,独立库
特别是在MSVC中,是否可以构建不需要该项目的库来使用C ++运行时的特定版本?如果是这样,如何实现这样的壮举?
我想构建一个包含一个简单函数f
的库,该函数又来自某些版本的MSVC CRT呼叫函数,并从其他第三方库中调用函数。最终产品应该是我可以链接到我喜欢的任何项目的库,而不会引起CRT版本的冲突,或者抱怨重新定义的CRT符号,或者抱怨图书馆消耗的第三方依赖项中缺少符号。
换句话说,我想完成函数实现的详细信息f
,仅导出f
本身。
如果根本没有这样的事情,请提供有关为什么不可行的解释。我对extern“ c”
等其他限制开放,或者要求库为dll而不是静态库。
Specifically in MSVC, is it possible to build a library that doesn't require the project that consumes it to use a specific version of the C++ runtime? If so, how would such a feat be accomplished?
I would like to build a library containing, for example, a simple function F
that in turn calls functions from some version of the MSVC CRT, as well as calling functions from other 3rd-party libraries. The end product should be a library that I can link to any project I like, without causing conflicts in CRT versions, or complaining about redefined CRT symbols, or complaining about missing symbols from 3rd party dependencies that the library consumes.
In other words, I would like to complete encapsulate the details of the implementation of function F
, exporting only F
itself.
If such a thing is not at all possible, please provide an explanation as to why it is not feasible. I am open to additional restrictions such as extern "C"
or requiring that the library be a dll rather than a static library.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论