I am having issues building the GLM library. I am using Windows and VS Code. I have the following installed:
- Mingw64 that includes gcc and g++ compilers
- cmake
For GLM, as instructed in their readme:
I downloaded the latest release and extracted it to c:\glm
I navigated to the folder in the command prompt and ran the command
C:\cmake\bin\cmake -DGLM_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -B build .
I got the following error:
CMake Error in CMakeLists.txt: Running 'nmake' '-?' failed with: no such file or directory CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
I tried with cmake-gui as well but I got the same error when I clicked configure.
I also have the cmake extension for VS Code so I tried configuring and building in VS Code, right clicking on the CmakeLists.txt and selecting "Clean Reconfigure All Projects". That resolved the compiler related errors:
[cmake] -- Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
[cmake] -- Check for working CXX compiler: C:/mingw64/bin/g++.exe - skipped
And I also didn't get the no such file or directory
error. However, when I tried to continue with the rest of the instructions, at the C:\cmake\bin\cmake --build build -- install
command, I got the mingw32-make: *** No rule to make target 'install'. Stop.
error.
I see that there are two cmakes (cmake.exe and mingw32-make) and I was thinking that may be causing issues but I haven't found how I can fix that issue.
I am having issues building the GLM library. I am using Windows and VS Code. I have the following installed:
- Mingw64 that includes gcc and g++ compilers
- cmake
For GLM, as instructed in their readme:
I downloaded the latest release and extracted it to c:\glm
I navigated to the folder in the command prompt and ran the command
C:\cmake\bin\cmake -DGLM_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -B build .
I got the following error:
CMake Error in CMakeLists.txt: Running 'nmake' '-?' failed with: no such file or directory CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
I tried with cmake-gui as well but I got the same error when I clicked configure.
I also have the cmake extension for VS Code so I tried configuring and building in VS Code, right clicking on the CmakeLists.txt and selecting "Clean Reconfigure All Projects". That resolved the compiler related errors:
[cmake] -- Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
[cmake] -- Check for working CXX compiler: C:/mingw64/bin/g++.exe - skipped
And I also didn't get the no such file or directory
error. However, when I tried to continue with the rest of the instructions, at the C:\cmake\bin\cmake --build build -- install
command, I got the mingw32-make: *** No rule to make target 'install'. Stop.
error.
I see that there are two cmakes (cmake.exe and mingw32-make) and I was thinking that may be causing issues but I haven't found how I can fix that issue.
Share Improve this question edited Jan 18 at 17:15 genpfault 52.1k12 gold badges91 silver badges148 bronze badges asked Jan 18 at 17:13 Murat AykanatMurat Aykanat 1,7084 gold badges31 silver badges39 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 0I want to provide what I did to solve this per the comments of @Tsyvarev and @drescherjm
I downloaded the actual source from the GLM releases page
After unzipping the source, at the root of the source, I ran the commands:
C:\cmake\bin\cmake -DGLM_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -B build . -G "MinGW Makefiles"
C:\cmake\bin\cmake --build build -- all
C:\cmake\bin\cmake --build build -- install
Adding "MinGW Makefiles" resolved the "compiler variable not set" errors I was getting and since the source contained the GLM_BUILD_INSTALL
, the install executed without errors.
install
target only whenGLM_BUILD_INSTALL
option is set. Check that you haven't disable that option. – Tsyvarev Commented Jan 18 at 17:35nmake
, it is described in that question. As you could find, that error is absolutely unrelated to yourinstall
error, and by including both of them into the question post you only make your question confusing. – Tsyvarev Commented Jan 18 at 17:38nmake
for MinGW. – drescherjm Commented Jan 18 at 17:51pacman
to install the correct version for what msys2 environment you select. VSCode recommends ucrt64 in their official MinGW instructions: https://code.visualstudio.com/docs/cpp/config-mingw – drescherjm Commented Jan 18 at 17:55