Portál AbcLinuxu, 9. května 2025 00:15
Nejde mi zkompilovat bezchybne napsany program:
(jsou tam tyto hlavickove soubory: iostream, stdio.h, stdlib.h, GL/glew.h, GLFW/glfw3.h, 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;
}
A tohle je vystup v netbeans
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/root/NetBeansProjects/pokus'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/pokus
make[2]: Entering directory `/root/NetBeansProjects/pokus'
mkdir -p build/Debug/GNU-Linux-x86
rm -f "build/Debug/GNU-Linux-x86/main.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/GNU-Linux-x86/main.o.d" -o build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -o dist/Debug/GNU-Linux-x86/pokus build/Debug/GNU-Linux-x86/main.o
build/Debug/GNU-Linux-x86/main.o: In function `main':
/root/NetBeansProjects/pokus/main.cpp:15: undefined reference to `glfwInit'
/root/NetBeansProjects/pokus/main.cpp:19: undefined reference to `glfwCreateWindow'
/root/NetBeansProjects/pokus/main.cpp:22: undefined reference to `glfwTerminate'
/root/NetBeansProjects/pokus/main.cpp:25: undefined reference to `glfwMakeContextCurrent'
/root/NetBeansProjects/pokus/main.cpp:28: undefined reference to `glewExperimental'
/root/NetBeansProjects/pokus/main.cpp:29: undefined reference to `glewInit'
collect2: error: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/pokus] Error 1
make[2]: Leaving directory `/root/NetBeansProjects/pokus'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/root/NetBeansProjects/pokus'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 3s)
Vsechny hlavickove soubory mam v spravne nainstalovane.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.