में लिनक्स में ओपन (GLFW) सी में आसान स्रोत ++ और संकलन नहीं कर सकते मैं ओपन (glfw) जानने के लिए शुरू कर दिया और मैं एक ट्यूटोरियल से स्रोत को कॉपी करें और संकलित करने के लिए कोशिश की, लेकिन त्रुटियां हुईं। मुझे लगता है मैं corectly सभी हेडर फाइल (GLM, glfw आदि)NetBeans
यह मेरा स्रोत है (मैं इन पात्रों का उपयोग नहीं किया: हेडर फाइल में <,>): स्थापित किया है
#include iostream
#include stdio.h
#include stdlib.h
#include GL/glew.h
#include GLFW/glfw3.h
#include glm/glm.hpp
#define GLFW_INCLUDE_GL_3
using namespace glm;
using namespace std;
int main(){
if(!glfwInit()){
return -1;
}
GLFWwindow* window; // (In the accompanying source code, this variable is global)
window = glfwCreateWindow(1024, 768, "Tutorial 01", NULL, NULL);
if(window == NULL) {
fprintf(stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n");
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
// Initialize GLEW
glewExperimental=true; // Needed in core profile
if (glewInit() != GLEW_OK) {
fprintf(stderr, "Failed to initialize GLEW\n");
return -1;
}
return 0;
}
और इस नेटबीन में आउटपुट है:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/jan/NetBeansProjects/a'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/a
make[2]: Entering directory `/home/jan/NetBeansProjects/a'
mkdir -p dist/Debug/GNU-Linux-x86
g++ -o dist/Debug/GNU-Linux-x86/a build/Debug/GNU-Linux-x86/main.o
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/jan/NetBeansProjects/a/main.cpp:12: undefined reference to `glfwInit'
/home/jan/NetBeansProjects/a/main.cpp:16: undefined reference to `glfwCreateWindow'
/home/jan/NetBeansProjects/a/main.cpp:19: undefined reference to `glfwTerminate'
/home/jan/NetBeansProjects/a/main.cpp:22: undefined reference to `glfwMakeContextCurrent'
/home/jan/NetBeansProjects/a/main.cpp:25: undefined reference to `glewExperimental'
/home/jan/NetBeansProjects/a/main.cpp:26: undefined reference to `glewInit'
collect2: error: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/a] Error 1
make[2]: Leaving directory `/home/jan/NetBeansProjects/a'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/jan/NetBeansProjects/a'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 462ms)
कृपया मेरी मदद करें। आपके समय के लिए शुक्रिया।
आप इसे से लिंक हो रहा नहीं कर रहे हैं:
मैं लिंकर के लिए ये पैरामीटर जोड़ा? – lpapp
ऊपर सूचीबद्ध "अपरिभाषित संदर्भ" आइटम पर ध्यान दें। उनको हल करने की जरूरत है। – STLDeveloper
मैं कैसे हल कर सकता हूं? –