简体   繁体   中英

C++ Standard for Visual Studio 2015

I am trying to install MongoDB driver and is reading this following section https://github.com/mongodb/mongo-cxx-driver/wiki/Download-and-Compile-the-Legacy-Driver

SCons Options when Compiling the C++ Driver

Select options as appropriate for your environment. Please note that some flags may not be available on older versions.

Important note about C++11/C++14: The boost libraries do not offer a stable ABI across different versions of the C++ standard. As a result, you must ensure that your application, the C++ driver, and boost are all built with the same language standard. In particular, if you are building the C++ driver with C++11 enabled, you must also build your application with C++11 enabled, and link against a C++11 compiled boost. Note that on most systems, the system or package installed boost distribution is not built with C++11, and is therefore incompatible with a C++11 build of the legacy driver.

Important note about the C++ standard library: Much like the C++11 issues, it is again critical that all three components (your application, boost, and the C++ driver) be built against the same C++ runtime library. You cannot mix components that have linked against libc++ with those that have linked against libstdc++.

Important 26compat Note: If you are using the 26compat branch, the install-mongoclient target is only enabled when the --full flag is provided. Similarly, you must use the --use-system-boost flag when building 26compat.*

My main question, I am trying to find out what standard my visual studio 2015 is running on when I build solution. I have tried to read around but I think I misunderstood the concept of C++11 and C++14. On Microsoft page it mentioned that VS2015 supports C++11,C++14 and C++17. But how do I know what am I using now? I can't find a way to explicitly configure. I am new to C++ and have been coding Java for many years. C++ is confusing to me because there are so many variety such as compilers and standards. Please help me understand and possibly find out what standard I am running.

The text is mostly nonsense.

ABI's are dictated by compilers, not standards. There is no ABI for C++11, there's one for GCC and a different one for MSVC2015.

"C++11 enabled" is a setting on GCC, and it does affect their ABI. The same applies to libc++ versus libstdc++, neither is part of the C++11 standard. Also, the mixing of build environments and the OS ("system Boost version") is mostly a Linux thing.

MSVC++ isn't GCC, and it doesn't use libstdc++, so all this does not affect you. And Boost versions aren't even a MSVC++ setting anymore, for the last few versions library configuration has been a per-project setting instead. (Tip: Create a Boost.vsprops file for that)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM