C++ 在Windows中的NetBeans上设置OpenGL

C++ 在Windows中的NetBeans上设置OpenGL,c++,opengl,netbeans,C++,Opengl,Netbeans,我正在尝试在Netbeans 8.1中设置OpenGL。我已经安装了MinGW作为C++编译器,它工作。p> 我想使用GLEW和GLFW库,因此我下载了它们,并创建了一个包含文件夹,在其中存储了所有.h文件,以及一个libs文件夹,在其中存储了glew32.lib和glfw3.lib。我已通过设置在NetBeans中包含include文件夹 项目属性>构建>C++编译器>包含目录 我已经通过设置将bin文件夹包括在NetBeans中 项目属性>构建>链接器>库 然后,在main.cpp文件中,我

我正在尝试在Netbeans 8.1中设置OpenGL。我已经安装了MinGW作为C++编译器,它工作。p> 我想使用GLEWGLFW库,因此我下载了它们,并创建了一个包含文件夹,在其中存储了所有.h文件,以及一个libs文件夹,在其中存储了glew32.libglfw3.lib。我已通过设置在NetBeans中包含include文件夹

项目属性>构建>C++编译器>包含目录

我已经通过设置将bin文件夹包括在NetBeans中

项目属性>构建>链接器>库

然后,在main.cpp文件中,我插入了GLEW和GLFW的include,但当我执行mi文件时,会得到这个输出错误

cd 'D:\Documenti\NetBeansProjects\Test'
C:\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/d/Documenti/NetBeansProjects/Test'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/test.exe
make.exe[2]: Entering directory `/d/Documenti/NetBeansProjects/Test'
mkdir -p dist/Debug/MinGW-Windows
g++     -o dist/Debug/MinGW-Windows/test build/Debug/MinGW-Windows/main.o -l glew32 -lglfw3
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lglew32
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lglfw3
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/test.exe] Error 1
make.exe[2]: Leaving directory `/d/Documenti/NetBeansProjects/Test'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/d/Documenti/NetBeansProjects/Test'
make.exe": *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 1s)

有人知道如何解决这个问题吗?

链接器找不到您的库,因为您没有告诉NetBeans它们存储的目录。请浏览:

项目属性->链接器->附加库目录


并将此目录添加到您的NetBeans项目中。之后,您将在编译/link时看到附加链接器选项
-L

谢谢,它很有效。我不能给你的答案打分,因为我的名声太差了low@AndreaFino-很高兴听到!