This is driving me mad, I want to statically link to GLFW.lib, following section 4.2.1. of the readme.html file provided I have added glfw.lib and opengl32.lib to the additional dependancies section of the linker on VS.
I've also added the dir including glfw.lib to the additional library directories section under linker > general.
And of course I have included the glfw.h file in my project, yet I'm still getting...
Error 1 error LNK2019: unresolved external symbol _glfwInit referenced in function _main C:\Users\Smith_000\Documents\Visual Studio 2012\Projects\Spark\Spark\main.obj Spark Error 2 error LNK2019: unresolved external symbol _glfwTerminate referenced in function _main C:\Users\Smith_000\Documents\Visual Studio 2012\Projects\Spark\Spark\main.obj Spark Error 3 error LNK2019: unresolved external symbol _glfwOpenWindow referenced in function _main C:\Users\Smith_000\Documents\Visual Studio 2012\Projects\Spark\Spark\main.obj Spark Error 4 error LNK2019: unresolved external symbol _glfwSwapBuffers referenced in function _main C:\Users\Smith_000\Documents\Visual Studio 2012\Projects\Spark\Spark\main.obj Spark Error 5 error LNK2019: unresolved external symbol _glfwGetWindowParam referenced in function _main C:\Users\Smith_000\Documents\Visual Studio 2012\Projects\Spark\Spark\main.obj Spark Error 6 error LNK2019: unresolved external symbol _glfwGetKey referenced in function _main C:\Users\Smith_000\Documents\Visual Studio 2012\Projects\Spark\Spark\main.obj Spark Error 7 error LNK1120: 6 unresolved externals C:\Users\Smith_000\Documents\Visual Studio 2012\Projects\Spark\Debug\Spark.exe 1 1 Spark
With the following (example) code...
#include <glfw.h> #include <stdlib.h> int main( void ) { int running = GL_TRUE; // Initialize GLFW if( !glfwInit() ) { exit( EXIT_FAILURE ); } // Open an OpenGL window if( !glfwOpenWindow( 300,300, 0,0,0,0,0,0, GLFW_WINDOW ) ) { glfwTerminate(); exit( EXIT_FAILURE ); } // Main loop while( running ) { // OpenGL rendering goes here... glClear( GL_COLOR_BUFFER_BIT ); // Swap front and back rendering buffers glfwSwapBuffers(); // Check if ESC key was pressed or window was closed running = !glfwGetKey( GLFW_KEY_ESC ) && glfwGetWindowParam( GLFW_OPENED ); } // Close window and terminate GLFW glfwTerminate(); // Exit program exit( EXIT_SUCCESS ); }
What am I doing wrong?