OpenGL MSYS2 链接器

问题描述 投票:0回答:0

我通过 MSYS2 安装了 glew、glfw 和 glm 库。我正在尝试使用链接器对其进行编译,但出现以下错误:

g++ main.cpp -o main -g -lglfw -lpthread -lX11 -ldl -lXrandr -lGLEW -lGL -DGL_SILENCE_DEPRECATION -DGLM_ENABLE_EXPERIMENTAL -I.
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lglfw: No such file or directory
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lX11: No such file or directory
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldl: No such file or directory
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lXrandr: No such file or directory
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lGLEW: No such file or directory
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lGL: No such file or directory
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:2: all] Error 1

msys 在哪里安装链接器文件或我如何安装这些文件?我怎样才能为它设置正确的路径?我是否需要更改链接器文件的名称以及如何找到正确的文件?

我重新安装了库。我检查了每个目录。

c++ opengl mingw glfw msys2
© www.soinside.com 2019 - 2024. All rights reserved.