CLion

To run a program in CLion you need a compiler. If you already have Visual Studio with C++ installed then you already have a compiler and just need to configure it in File -> Settings -> Build, Execution, Deployment -> Toolchains

The Visual Studio toolchain does not allow debugging however so you will want to add MinGW. Just choose it in Toolchains and click Download. The defaults are fine.

Programs written on Macs may need Cygwin. See instructions. Be sure to add to PATH.

Standalone Executable

Add set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc") under set(CMAKE_CXX_STANDARD 14) in CMakeLists.txt

Find exe in cmake-build-debug folder

Debugging Tools in CLion

  1. Configure a toolchain other than Visual Studio (if you don't already have one)

    1. File -> Settings -> Build, Execution, Deployment -> Toolchains. MinGW - Download, install, choose location like C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32

    2. Move that environment to the top

  2. Add breakpoint

  3. Run -> Debug

    1. Step into and step over

Help