# glfw "undefined reference to glfwInit"

This topic is 2662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I had the following code (abbreviated for illustration purposes) building fine, except for the fact that it was unable to find glu.h:

#include <GL/glfw.h> using namespace std; int main() { int running = GL_TRUE; if ( !glfwInit() ) { exit(EXIT_FAILURE); } if (!glfwOpenWindow(900, 750, 0, 0, 0, 0, 0, 0, GLFW_WINDOW)) { glfwTerminate(); exit(EXIT_FAILURE); } while (running) { // Game code } return 0; }

After some digging, I was able to install the xorg devel package that set up glu.h. However, now I get glfw errors like 'undefined reference to glfwInit' and also for glfwOpenWindow and glfwTerminate.

The odd thing is that those methods are available in code completion lists for both the #include and the method calls. I've tried reinstalling the glfw and glfw-devel packages to no avail.

Any ideas?

##### Share on other sites
"Undefined reference to" is an error from the linker. How are you compiling or linking the program? If you're doing it by hand on the command line or in your own Makefile, do you have "-lglfw" (dash, lower case "L", "glfw") somewhere in there?

##### Share on other sites
I'm using Qt Creator, so it is handling the compiling and linking. Is there someplace I need to make the reference?

##### Share on other sites
I found a way to add a reference to an external library (glfw) and that seemed to fix the problem. Now I need to do some digging into the subsequent issue - errors related to ATIFGLEXTENSION...

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633725
• Total Posts
3013558
×