Can't link in VC++ Express 2005?

nobody wrote on Friday, September 07, 2007:

Hi all, after working with GLUT, I thought i would try something new, and GLFW really seems to be a great framework. I started to compile my first program (yay), but I got this problem:

[IMG]http://i27.photobucket.com/albums/c152/Japigeman/linkererrors.png[/IMG]
http://i27.photobucket.com/albums/c152/Japigeman/linkererrors.png

I can’t seem to get the linker to find the GLFW calls, but the correct .lib files are added to the dependencies

Any ideas?
(note: i keep my lib files in a seperate dir from the other libs, so I can move the project around more easily, but the linker has no trouble actually finding the .lib files)

nobody wrote on Friday, September 07, 2007:

Ok, tried it with MSVS 2005 from scratch. Same problem.

nobody wrote on Tuesday, September 11, 2007:

I have the same problem and found this solution:

Edit the following lines in glfw.h:

// We are either building/calling a static lib or we are non-win32
#define GLFWAPIENTRY
#define GLFWAPI
#define GLFWCALL

to

// We are either building/calling a static lib or we are non-win32
#define GLFWAPIENTRY __stdcall
#define GLFWAPI
#define GLFWCALL __stdcall

elmindreda wrote on Saturday, September 15, 2007:

Hi guys, sorry for taking so long to respond.

Are you using the static GLFW library or the link library for the GLFW DLL?

elmindreda wrote on Saturday, September 15, 2007:

A bug related to this issue has been found. Please see this tracker item for details:

https://sourceforge.net/tracker/index.php?func=detail&aid=1795595&group_id=72569&atid=534938

raveler wrote on Sunday, December 23, 2007:

I also encountered a problem. The actual library (not the dll, but glfw.lib) links fine, but the examples do not, because libc.lib is not available in the standard path for VS2005 (this is different from VS2003). The error messages are confusing, and one might think that the library itself failed to build.

So in short: the library actually builds with VS2005, but the examples do not, which causes confusion. Maybe this can be resolved in some way?

purew wrote on Sunday, December 23, 2007:

I think it’s the same problem in VC++ Express 2008:

http://pici.se/pictures/vClVKEWEb.png

purew wrote on Sunday, December 23, 2007:

Forgot the extra info for the above post:
Using VC++ Express 2008,
trying to link statically,
headers and libs correctly linked.

I tried the fix to glfw.h a few posts above to no success.

nobody wrote on Wednesday, March 12, 2008:

I am getting same problems; even when pointing vs8 express to absolute path where dll or lib reside, it says it can’t find glfw.lib; It doesn’t matter if static or dll. Has anyone find a solution for this? I don’t have similar problems with any other code.

Libs itself compile just fine, both static, dynamic and in release and debug mode.

by the way @Camilla, if you are still visiting this thread; it is unneccesary to have two projects just to make two different builds. You can have one project and as many builds as you wish. (Right click on "solution explorer" and then check out "batch build" and "configuration manager"). You just add as many configurations you wish through configuration manager and then batch build/clean them all. If you want I can send my solution where I have removed second project, and added different configurations.