DEV Community

Tuan Tu Tran
Tuan Tu Tran

Posted on

2

Build a project on Windows 11 using MinGW

Assuming that the CMakeLists.txt is located in the root folder of the project, follow these steps:

  • 1. Create a build folder:

mkdir build

  • 2. Change to the build folder:

cd build

  • 3. Use MinGW to generate the Makefile

cmake -G "MinGW Makefiles" ..

(The ".." at the end of the cmake command tellls it to look for the CMakeLists.txt file in the parent directory)

+4. Compile the project using mingw32-make:

mingw32-make

Reference:
[1]https://cmake.org/cmake/help/v3.12/generator/MinGW%20Makefiles.html

Top comments (0)

👋 Kindness is contagious

Dive into this thoughtful piece, beloved in the supportive DEV Community. Coders of every background are invited to share and elevate our collective know-how.

A sincere "thank you" can brighten someone's day—leave your appreciation below!

On DEV, sharing knowledge smooths our journey and tightens our community bonds. Enjoyed this? A quick thank you to the author is hugely appreciated.

Okay