Errors compiling example code

cellsheet wrote on Monday, August 26, 2013:

Hello, when I had tried to compile the example code for glfw3, I got the following errors:

/tmp/ccCdEKoi.o: In function main': example.cpp:(.text+0x38): undefined reference toglfwCreateWindow’
example.cpp:(.text+0x5b): undefined reference to glfwMakeContextCurrent' example.cpp:(.text+0x7a): undefined reference toglfwWindowShouldClose’
collect2: error: ld returned 1 exit status

I am compiling with g++ example.cpp -o example -lGL -lglfw and when I installed the latest glfw 3.0.2, it installed without problems.

codesnip3r wrote on Wednesday, August 28, 2013:

Looks like you need to link in the glfw library directory.

Try using -L/path/to/glfw