1

I am currently working on converting some of my applications to C++, and for that i have decided to use openGL, as ive got some experience with it from other platforms. But getting this to compile in x64 seems to be quite a lot of hassle. To check if my linking stuff is working i am just trying to compile this tutorial:

http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/

But as you can see, i failed miserably. I have downloaded and installed:

  • freeglut
  • GLM
  • GLFW
  • GLEW

The issue clearly seems to lay within GLFW. I am using Visual express c++ 2010.

I installed GLFW like this:

  • GLFW.dll (System32)
  • glfw.h (C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\gl)
  • GLFW.lib (C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64)
  • GLFWDLL.lib (C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64)

My linker:

kernel32.lib;glu32.lib;glew32.lib;GLFW.lib;GLFWDLL.lib;opengl32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)

Output:

1>------ Build started: Project: Spacecraft, Configuration: Debug x64 ------
1>  Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwGetWindowParam referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwGetKey referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwSwapBuffers referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwEnable referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwSetWindowTitle referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwTerminate referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwOpenWindow referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwOpenWindowHint referenced in function main
1>Main.obj : error LNK2019: unresolved external symbol __imp_glfwInit referenced in function main
1>c:\users\leif andreas\documents\visual studio 2010\Projects\Spacecraft\x64\Debug\Spacecraft.exe : fatal error LNK1120: 9 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And finally, my includes:

// Include standard headers
#include <stdio.h>
#include <stdlib.h>

// Include GLEW
#include <gl/glew.h>
#include <gl/glut.h>

// Include GLFW
#include <gl/glfw.h>

// Include GLM
#include <glm/glm.hpp>
using namespace glm;
genpfault
  • 51,148
  • 11
  • 85
  • 139
user1419305
  • 468
  • 8
  • 16
  • [This](http://stackoverflow.com/a/4716894/1569168) may be helpful. – ErikEsTT Sep 07 '12 at 10:50
  • Thanks, but im not really sure if that is the solution, the output is pointing to glfw. – user1419305 Sep 07 '12 at 11:58
  • [Here](http://www.glfw.org/faq.html#3_2) is written, that in `readme.html` in section 4.2.2 is written how to correct link GLFW: To compile a program that uses the DLL version of GLFW, you need to define the **GLFW_DLL** constant. This can either be done with a compiler switch, typically by adding **-DGLFW_DLL** to the list of compiler options. You can also do it by adding the line: #define GLFW_DLL to all your source files that include **glfw.h**, before including it. – ErikEsTT Sep 07 '12 at 12:35
  • Thanks, tried it, but it still returns the same errors! Could it be that glfw does not support x64 via the vc10 compiler? – user1419305 Sep 07 '12 at 13:10
  • What version of GLFW you use? I found [this](http://www.gamedev.net/topic/613832-64-bit-glfw-on-windows/) which point to [this](http://wiki.glfw.org/wiki/Roadmap_for_GLFW_3). So `Windows 64-bit support` is in GLFW 3.0. – ErikEsTT Sep 07 '12 at 15:03
  • GLFW 2.76 definitely supports x64 with VC10; I use it daily. Have you tried using GLFW's static library instead of its DLL configuration? It tends to be easier to set up initially. – postgoodism Sep 07 '12 at 15:11
  • Because i am new to OpenGL on windows, i am just running with the 2.7.6 release of GLFW. I dont really know better atm. – user1419305 Sep 07 '12 at 15:35
  • Ok, gave up on trying to get it to work on x64, just converted everything back to 32bit and now it works! But still, thanks to everyone who tried to help out, even though it didnt work it, i really appreciate the amount of help i get! ;-) – user1419305 Sep 08 '12 at 11:47

0 Answers0