Skip to content

Instantly share code, notes, and snippets.

@carlosdelfino
Forked from Bluexin/msys2.md
Created July 15, 2020 22:57

Revisions

  1. @Bluexin Bluexin revised this gist Mar 28, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions msys2.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    * [Windows](#windows)
    * [32bits target](#32bits-target-(win))
    * [64bits target](#64bits-target-(win))
    * [32bits target](#32bits-target-win)
    * [64bits target](#64bits-target-win)
    * [Setting up QtCreator](#setting-up-qtcreator)

    ## Windows
  2. @Bluexin Bluexin created this gist Mar 28, 2018.
    41 changes: 41 additions & 0 deletions msys2.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    * [Windows](#windows)
    * [32bits target](#32bits-target-(win))
    * [64bits target](#64bits-target-(win))
    * [Setting up QtCreator](#setting-up-qtcreator)

    ## Windows
    Common steps :

    * Install [MSYS2-x86_64](http://www.msys2.org/)
    * At the end of the installation, run it (either automatically or manually)
    * Execute the command `pacman -Syu` to update core packages, then close the terminal when prompted
    * Run it again, and execute `pacman -Su` to update some more packages
    I will refer to the MSYS2 installation path as `MSYS2_PATH`. By default it is `c:/msys64` on 64-bits systems.

    ### 32bits target (win)
    Run MSYS2 MinGW **32**-bit

    * `cd` (or `pushd`) to the directory you cloned this repo to
    * Execute `pacman --needed -S mingw-w64-i686-toolchain mingw-w64-i686-qwt-qt5` (pacman will prompt about what packages to install, just press `[enter]`)
    * Done!

    To use this toolchain, point CMake to `(MSYS2_PATH)/mingw32` (not needed with QtCreator, see instructions below)

    ### 64bits target (win)
    Run MSYS2 MinGW **64**-bit

    * `cd` (or `pushd`) to the directory you cloned this repo to
    * Execute `pacman --needed -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-qwt-qt5` (pacman will prompt about what packages to install, just press `[enter]`)
    * Done!

    To use this toolchain, point CMake to `(MSYS2_PATH)/mingw64` (not needed with QtCreator, see instructions below)

    ### Setting up QtCreator

    1. Open the "Build & Run" panel in QtCreator options
    2. In the "Qt Versions" tab, add a new one pointing to `(MSYS2_PATH)/mingw(32/64)/bin/qmake.exe` (usually `C:\msys64\mingw64\bin\qmake.exe`)
    3. In the "Compilers" tab, add a new one for MinGW C and C++, respectively pointing to `(MSYS2_PATH)/mingw(32/64)/bin/gcc.exe` and `.../g++.exe`
    4. In the "Debuggers" tab, add a new one pointing to `(MSYS2_PATH)/mingw(32/64)/bin/gdb.exe`
    5. In the "CMake" tab, add a new one pointing to `(MSYS2_PATH)/mingw(32/64)/bin/cmake.exe`
    6. In the "Kits" tab, add a new one where you use the compilers, debugger, qt and cmake defined above
    7. Select "CodeBlocks - Ninja" as CMake Generator