c++ 14 for sublime windoes build system

Sure! Here is a step-by-step guide to setting up a C++14 build system for Sublime Text on Windows:

  1. Open Sublime Text: Launch Sublime Text on your Windows machine.

  2. Create a New Build System: Go to "Tools" in the menu bar and select "Build System" > "New Build System". This will open a new file in Sublime Text.

  3. Configure the Build System: In the newly opened file, paste the following code:

{
    "cmd": ["g++", "-std=c++14", "${file}", "-o", "${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]):([0-9]+):?([0-9]+)?:? (.)$",
    "working_dir": "${file_path}",
    "selector": "source.c++",
    "variants":
    [
        {
            "name": "Run",
            "cmd": ["start", "cmd", "/k", "${file_path}/${file_base_name}.exe"]
        }
    ]
}
  1. Save the Build System: Save the file with a meaningful name, such as "C++14.sublime-build". Make sure to save it with the ".sublime-build" extension.

  2. Set the Build System: Go to "Tools" > "Build System" and select "C++14" (or the name you used in step 4) from the dropdown menu. This tells Sublime Text to use the C++14 build system for compiling and running C++ code.

  3. Test the Build System: Open a C++ file in Sublime Text and press "Ctrl + B" (or go to "Tools" > "Build") to compile the code using the C++14 build system. If there are no errors, you should see a compiled executable file in the same directory as your C++ file.

  4. Run the Code: To run the compiled code, press "Ctrl + Shift + B" (or go to "Tools" > "Build With" > "C++14 - Run"). This will open a command prompt window and execute the compiled executable.

That's it! You have successfully set up a C++14 build system for Sublime Text on Windows. Let me know if you need further assistance!