Skip to content

LearnOpenGL code samples CMake build fails for MSYS2/MinGW on Windows #421

@mayd

Description

@mayd

I encountered several problems attempting to build the sample code on Windows under MSYS2/MinGW/CMake.

  1. CMake build failed due to MSYS2 CMake version being too recent. (fixed)
  2. CMake build failed due to GNU link errors. (fixed)

I was able to find workarounds for both errors.

  1. Build with the following command line: (cd build; cmake -G"MSYS Makefiles" -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..; cmake --build .)
  2. Edit the file CMakeLists.txt to enable support for MSYS2/MinGW. (I have attached a small patch with this report)

NB I am not an expert in CMake nor OpenGL so this is a bit ad-hoc but all sample code built successfully and the executables seem to work.

CMakeLists.txt-msys2.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions