Skip to main content

C/C++

In order to start with C/C++, you must first install the appropriate software for your operating system:

  • Windows (for NodeJS and in-system builds): Install the Build Tools for Visual Studio 22 and follow the Visual Studio and C/C++ support guide

  • Windows (Linux on Windows): Install the latest version of MSYS2

    Make sure to run these commands on your first run (in MSYS2 MINGW64):

    # Check for package updates
    pacman -Syu # You might need to run this command twice. If it asks to close some programs, say yes and rerun.
    # Install some basic GCC tools
    pacman -S mingw-w64-x86_64-gcc pacman mingw-w64-x86_64-make mingw-w64-x86_64-gdb
  • Linux: C/C++ installation guide

    It is also recommended to install the following libraries:

    sudo apt install build-essential # Needed to install the g++ compiler command!
    sudo apt install libboost-all-dev # Boost C++ Libraries

CMake

CMake is used to enable a uniform building experience across different platforms. You can download CMake binaries/executables for your specific platform from the official CMake website.

note

If you are a Windows user, make sure to install cmake on Windows itself; not on your virtual machine!

If you are using MSYS2, run the following commands to install CMake:

# Install "cmake"
pacman -S mingw-w64-x86_64-cmake
# Install "make"
pacman -S make

For each platform, the generated build files will be targeted towards different building tools:

  • Windows (using VS): The generated files are for a Visual Studio project
  • Windows (using MSYS2): The generated files are for the Ninja builder
  • Linux: (unsure?)

You might need to look up how to initate the building stage specificly for your platform's building tools! But, in most cases, you can get away with running this command:

cmake --build . --config Release # Release/Beta