【发布时间】:2020-11-02 05:48:14
【问题描述】:
我想使用 OpenGL GLEW 库。我已经下载了二进制文件,它的文件夹在我的 .cpp 文件所在的文件夹中。我的 .cpp 文件使用 #include <eglew.h>。
我应该如何格式化 MinGW 的命令来编译我的 .cpp 文件?我是用像g++ -L./path/to/lib/file.lib test.cpp -o test 这样的.lib 文件编译还是做其他事情,比如链接到头文件g++ -I./path/to/headers test.cpp -o test?
【问题讨论】:
-
您可以尝试:
g++ -L./path/to/lib/file.lib -I./path/to/headers test.cpp -o test,将您的包含<eglew.h>更改为"eglew.h"可能会有所帮助。 -
您似乎必须输入错误的二进制文件。 MinGW 通常与
.a一起工作,而不是.lib。