Jump to content
  • Advertisement
Sign in to follow this  
Quasimojo

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
"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 this post


Link to post
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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!