A demonstration of import std in Visual Studios, VS Code, and from command line.
- Install and/or update Visual Studios to version 17.14.25 (help -> about should show
Version 17.14.25 (January 2026)or newer) - In the visual studios installer, modify visual studios 2022, under workloads -> desktop development with C++ -> optional -> ensure you have
C++ CMake tools for Windowsinstalled - Install and/or update CMake to version 4.2.3 (from powershell,
cmake --versionshould print4.2.3or newer*) - Install and/or update Ninja to version 1.13.2 (from powershell,
ninja --versionshould print1.13.2or newer) - Run
git clone https://github.com/TheNitesWhoSay/cmake_import_std.git
* If you have a newer (or different, but earlier versions may not work at all) version of CMake, make note of what version; then in the following URL: https://github.com/Kitware/CMake/blob/v4.2.3/Help/dev/experimental.rst replace 4.2.3 with your version, then in the link find CMAKE_EXPERIMENTAL_CXX_IMPORT_STD and copy the value, and in CMakeLists.txt replace d0edc3af-4c50-42ea-a356-e2862fe7a444 with your copied value.
- Right click in the cmake_import_std folder and open with visual studios
- Wait for CMake generation to finish
- Hit f5, the program should compile, run and print
Hello import std!
- Open the cmake_import_std folder in visual studios code
- Hit the build button in the bottom left, select visual studios 2022 x86
- Hit the play button in the bottom left, project should build, run and print
Hello import std!to the terminal
- Open powershell to the cmake_import_std folder
- Run
mkdir build,cd build,cmake ../, and finallycmake --build . - Run
./Debug/import_std.exe, it should printHello import std!