c++ - glfw3 specific refrences missing with glfw3 -
when had tried compile example code glfw3 on http://www.glfw.org/documentation.html (copy/pasted test compilation), got following errors:
/tmp/cccdekoi.o: in function main': example.cpp:(.text+0x38): undefined reference toglfwcreatewindow' example.cpp:(.text+0x5b): undefined reference glfwmakecontextcurrent' example.cpp:(.text+0x7a): undefined reference toglfwwindowshouldclose' collect2: error: ld returned 1 exit status
i compiling g++ example.cpp -o example -lgl -lglfw
, when installed latest glfw 3.0.2, installed without problems.
glfw3 builds libglfw3
default, not libglfw
glfw2 did. you're still linking against glfw2 installation.
solution:
g++ example.cpp -o example -lgl -lglfw3
Comments
Post a Comment