rejamoto wrote on Sunday, May 04, 2014:
Hi,
I’m trying to build a project with the example code from GLFW site and I’m not having much luck building GLFW as a static DLL. I got it working with GLFW as a dynamic library, but not static. Any help would be nice.
Using CodeBlocks 13.12 with Mingw 4.8.1 on Windows 7 64.
I get this when I build.
||=== Build: Debug in GLFW_Quick (compiler: Mingw 4.8.1 x86 pthread rev4) ===|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|9|warning: unused parameter 'error' [-Wunused-parameter]|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|14|warning: unused parameter 'scancode' [-Wunused-parameter]|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|14|warning: unused parameter 'mods' [-Wunused-parameter]|
obj\Debug\main.o||In function `key_callback':|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|17|undefined reference to `_imp__glfwSetWindowShouldClose'|
obj\Debug\main.o||In function `main':|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|24|undefined reference to `_imp__glfwSetErrorCallback'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|26|undefined reference to `_imp__glfwInit'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|29|undefined reference to `_imp__glfwCreateWindow'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|33|undefined reference to `_imp__glfwTerminate'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|37|undefined reference to `_imp__glfwMakeContextCurrent'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|38|undefined reference to `_imp__glfwSetKeyCallback'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|44|undefined reference to `_imp__glfwGetFramebufferSize'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|46|undefined reference to `glViewport@16'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|47|undefined reference to `glClear@4'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|48|undefined reference to `glMatrixMode@4'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|49|undefined reference to `glLoadIdentity@0'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|50|undefined reference to `glOrtho@48'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|51|undefined reference to `glMatrixMode@4'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|52|undefined reference to `glLoadIdentity@0'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|53|undefined reference to `_imp__glfwGetTime'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|53|undefined reference to `glRotatef@16'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|54|undefined reference to `glBegin@4'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|55|undefined reference to `glColor3f@12'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|56|undefined reference to `glVertex3f@12'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|57|undefined reference to `glColor3f@12'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|58|undefined reference to `glVertex3f@12'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|59|undefined reference to `glColor3f@12'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|60|undefined reference to `glVertex3f@12'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|61|undefined reference to `glEnd@0'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|62|undefined reference to `_imp__glfwSwapBuffers'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|63|undefined reference to `_imp__glfwPollEvents'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|40|undefined reference to `_imp__glfwWindowShouldClose'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|66|undefined reference to `_imp__glfwDestroyWindow'|
X:\Programming\C++\OpenGL\GLFW Projects\GLFW_Quick\main.cpp|68|undefined reference to `_imp__glfwTerminate'|
||=== Build failed: 30 error(s), 3 warning(s) (0 minute(s), 0 second(s)) ===|