begah wrote on Friday, November 28, 2014:
I have, in my opinion, installed and configured GLFW 3 correctly,
my compiler tells me otherwise.
glfw3.h and glfw3native.h are in urs/local/include/GLFW/.
libglfw3.a is in urs/local/lib/.
In Eclipse, i configured in Project Propreties->C/C++ Build->Settings->GCC C Linker->Libraries the following values : GL, GLU, m, rt, pthread, m, glfw3, X11, Xxf86vm, Xrandr and Xi.
In my project, in Test.c i have the following test code :
:::c
/*
============================================================================
Name : Test.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
#include <GLFW/glfw3.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
if (!glfwInit())
exit(EXIT_FAILURE);
return EXIT_SUCCESS;
}
So in my opinion and what i have read one the internet, it seems an alright setup.
When i compile it it gives this :
/usr/local/lib/libglfw3.a(window.c.o): In function `glfwCreateWindow':
window.c:(.text+0x724): undefined reference to `glClear'
//usr/local/lib/libglfw3.a(glx_context.c.o): In function `getFBConfigAttrib':
glx_context.c:(.text+0x4d): undefined reference to `glXGetFBConfigAttrib'
//usr/local/lib/libglfw3.a(glx_context.c.o): In function `chooseFBConfig':
glx_context.c:(.text+0x7a): undefined reference to `glXGetClientString'
glx_context.c:(.text+0xe5): undefined reference to `glXGetFBConfigs'
//usr/local/lib/libglfw3.a(glx_context.c.o): In function `createLegacyContext':
glx_context.c:(.text+0x41f): undefined reference to `glXCreateNewContext'
Reading this i came to the conclusion that it didn’t find OpenGL, but i already made OpenGL projects before and it works, so why can GLFW find it?
Thanks.