What is wrong with my installation of glfw3?

て烟熏妆下的殇ゞ 提交于 2021-01-28 10:14:13

问题


I tried to build glfw but something seems wrong with my installation with cmake under windows.

I tried to do the following steps to build the glfw-library with cmake:

git clone https://github.com/glfw/glfw
cd glfw
mkdir build-MinGW32
cd build-MinGW32

I then produced the build system "MinGW Makefiles" with cmake giving it the source directory (not the src folder) of the glfw repository:

$ cmake -G "MinGW Makefiles" ../

Result of former:

-- The C compiler identification is GNU 6.3.0

-- Check for working C compiler: D:/MinGW/bin/gcc.exe

-- Check for working C compiler: D:/MinGW/bin/gcc.exe -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Looking for pthread.h

-- Looking for pthread.h - not found

-- Found Threads: TRUE

-- Could NOT find Vulkan (missing: VULKAN_INCLUDE_DIR)

-- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found version "1.8.14") found components: doxygen

-- Looking for dinput.h

-- Looking for dinput.h - not found

-- Looking for xinput.h

-- Looking for xinput.h - not found

-- Performing Test _GLFW_HAS_DEP

-- Performing Test _GLFW_HAS_DEP - Success

-- Performing Test _GLFW_HAS_ASLR

-- Performing Test _GLFW_HAS_ASLR - Success

-- Performing Test _GLFW_HAS_64ASLR

-- Performing Test _GLFW_HAS_64ASLR - Failed

-- Using Win32 for window creation

-- Configuring done

-- Generating done

-- Build files have been written to: D:/Windows/Desktop/glfw/build-MinGW32

Then I build with the following command:

mingw32-make

After successful building of glfw I located the static library "libglfw3.a" inside the build subfolder "glfw\build-MinGW32\src".

In a test project which is using find_package(glfw3 3.2 REQUIRED), I set the cmake variable "glfw3_DIR to that subfolder. Which results in the following error:

~~~ OpenGLTutorial - v0.0 ~~~ CMake Error at D:/Windows/Desktop/glfw/build-MinGW32/src/glfw3Config.cmake:1 (include): include could not find load file:

D:/Windows/Desktop/glfw/build-MinGW32/src/glfw3Targets.cmake Call Stack (most recent call first):   CMakeLists.txt:12 (find_package)

Configuring incomplete, errors occurred! See also "D:/Windows/Desktop/OpenGLTutorial/build/CMakeFiles/CMakeOutput.log".


What I tried to fix it:

So I thought it had something to do with cmake not being able to find "glfw3Targets.cmake". I searched for it inside the source directory of glfw and found it inside "glfw\build-MinGW32\CMakeFiles\Export\lib\cmake\glfw3\" and copied it over inside the directory where the library build output "libglfw3.a" and "glfw3Config.cmake" is located.

But that is probably not the way people should install glfw. Also then cmake is outputting following error:

~~~ OpenGLTutorial - v0.0 ~~~ Configuring done CMake Error in playground/CMakeLists.txt: Imported target "glfw" includes non-existent path

"D:/Windows/Desktop/include"

in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

  • The path was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and references files it does not provide.

I would be really glad if someone could help me with what I'm doing wrong with building glfw.

Also if required information is missing please say so :)

来源:https://stackoverflow.com/questions/48594842/what-is-wrong-with-my-installation-of-glfw3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!