链接到使用旧版C ++标准编译的库是否安全? [英] Is it safe to link to libraries compiled with an older C++ standard?
问题描述
我使用C ++ 14标准编译了一堆库。即Boost,VTK和PCL。 PCL还包括仅头文件库Eigen。现在,我的项目需要一些C ++ 17的功能,所以我正在使用flag / std:c ++最新版本进行编译。我的
问题是,这会破坏与其他库的兼容性吗?如果是,我会得到编译时错误或警告,还是会编译成不安全的可执行文件?
嗨< a href ="https://social.msdn.microsoft.com/profile/patatahooligan/?ws=usercard-mini\"target ="_ blank">
patatahooligan,
感谢您在此发布。
>>我使用C ++ 14标准编译了一堆库。即Boost,VTK和PCL。 PCL还包括仅头文件库Eigen。现在,我的项目需要一些C ++ 17的功能,所以我正在使用flag / std:c ++最新版本进行编译。
我的问题是,这会破坏与其他库的兼容性吗?如果是,我会收到编译时错误或警告,还是会编译成不安全的可执行文件?
这取决于您使用的功能。 最方便的方法是尝试。
/ std:c ++最新开关将推进Visual C ++实现的一组功能,每个新版本的C ++标准工作草案。目前,它将跟踪我们为拟议的后C ++ 14草案
标准添加的功能。当下一个标准被批准时,使用/ std:c ++最新选择的语义将由/ std:c ++ 17覆盖(假设下一个标准是C ++ 17,但是标准委员会工作组  ;永远不要惊讶)
和/ std:c ++最新将继续跟踪下一个草案标准的功能。换句话说,使用/ std:c ++ latest,您将始终获得当前实现的所有新功能的集合,默认情况下为。
有关版本切换的更多信息,请参阅以下文件。
https://blogs.msdn.microsoft.com/vcblog/2016/06/07/standards-version-switches-in-the-compiler/
<希望这可以帮助你。
最好的问候,
Sera Yu
I've compiled a bunch of libraries using the C++14 standard. Namely, Boost, VTK and PCL. PCL also includes the header-only library Eigen. Now, my project needs some C++17 features, so I'm compiling with the flag /std:c++latest. My question is, can this break compatibility with the other libraries? If it does, will I get a compile-time error or warning, or will it compile to an unsafe executable?
thanks for posting here.
>>I've compiled a bunch of libraries using the C++14 standard. Namely, Boost, VTK and PCL. PCL also includes the header-only library Eigen. Now, my project needs some C++17 features, so I'm compiling with the flag /std:c++latest. My question is, can this break compatibility with the other libraries? If it does, will I get a compile-time error or warning, or will it compile to an unsafe executable?
It depends on the features you use. The most convenience way is to have a try.
The /std:c++latest switch will move forward the set of features implemented by Visual C++ with each new version of the C++ standards Working Draft. Currently it will track features that we add for the proposed post-C++14 draft standard. When the next standard is approved, the semantics opted-in with the /std:c++latest will be covered by /std:c++17 (assuming that the next standard is C++17, but the standards committee working group never ceases to surprise) and /std:c++latest will move forward to track the next draft standard’s features. In another words, with /std:c++latest, you will always get the set of all new features currently implemented and on by default.
For more information about version switches, please refer to this document below.
https://blogs.msdn.microsoft.com/vcblog/2016/06/07/standards-version-switches-in-the-compiler/
Hope this could be help of you.
Best Regards,
Sera Yu
这篇关于链接到使用旧版C ++标准编译的库是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!