Jump to content
  • Advertisement
Sign in to follow this  
ChesStrategy

Linking GLFW with VS2008 on Vista x64

This topic is 3500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can someone post a simple, comprehensive (step-by-step) tutorial on how to link GLFW with Visual Studio 2008. I've tried just about everything, and instead of debugging and trying to figure out where I possibly misplaced the .lib/.h files, I think its best if I just started from scratch; from the first step. I've read the README information in the glfw-v2.6.zip and I was confused on how to compile it. Since they apparently have the necessary lib files compiled for my convenience (glfw-2.6.bin.WIN32.zip), I used this file instead. I placed the glfw.h file into C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\GL and the glfw.lib, glfwdll.lib, glfwdll.dll into C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib I still get the following errors: 1>------ Build started: Project: WhiteSpace, Configuration: Debug Win32 ------ 1>Compiling... 1>Concept_1.cpp 1>Compiling manifest to resources... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Linking... 1>Concept_1.obj : error LNK2019: unresolved external symbol _glfwInit referenced in function _main 1>C:\Users\David Liu\Documents\Projects\WhiteSpace\WhiteSpace\Debug\WhiteSpace.exe : fatal error LNK1120: 1 unresolved externals From the following code: #include <iostream> #include <cstdlib> // For malloc() etc. #include <cstdio> // For printf(), fopen() etc. #include <cmath> // For sin(), cos() etc. #include "GL\glfw.h" #define GLFW_DLL using namespace std; int main( int argc, char **argv ) { cout << "testing GLFW \n"; glfwInit(); return 0; }

Share this post


Link to post
Share on other sites
Advertisement
Have you added glfwdll.lib library file to your project linker library list?

Btw it is not nice to put custom third party headers and libraries into compiler directories. Better put them besides your project sources/projecfile. And add necessary include paths to your C/C++ compiler settings.

Share this post


Link to post
Share on other sites
in win32 write this code after header file:

#include "GL/glfw.h"
#prgma comment(lib,"glfwdll.lib")

i think this works with win64 aslo

note: copy glew32.lib file into the <visual studio directory>\vc\lib

Share this post


Link to post
Share on other sites
I remember doing this recently. I had to make sure the runtime library was the same for both my project and GLFW.

Go to Project properties > Configuration properties > C/C++ > Code generation

and check what runtime library your project is using. (Mine was /MDd for example)

Now in the GLFW src, go to lib/win32, open Makefile.win32.msvc and add /MDd to the front of CFLAGS and CFLAGS_SPEED. And the same for the examples (there is a different Makefile for those).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!