Sikander Hayyat
Sikander Hayyat

Reputation: 115

How to setup Glew and Glut in Visual Studio 2012

By reading question you would get the idea about description.

Steps I done so far:

  1. download glut from internet
  2. copy glut.dll to windowsvow64 (I'm using x64).
  3. Copy glut header files to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\GL
  4. Copy glut.lib to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib

and done the same for glew and glfw. I edited additional libraries (glew.lib; glut.lib; etc)

But so far, its not compiling a simple program mentioned in this website.

Here are the errors

error LNK2019: unresolved external symbol _glfwInit referenced in function _main

(and many more are like this)

Upvotes: 1

Views: 796

Answers (3)

John
John

Reputation: 659

First of all, add your dll's to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin

If you have the includes and libs in the directories above then that should be fine.

Now right click on your project and select Properties

Go to linker and within this, select Input

make sure you have listed the required libraries in here like your glew.lib, freeglut.lib and the following which is recommended on the glfw website:

glfw3.lib, opengl32.lib (I'm assuming you're using glfw3)

See here for more info:

http://www.glfw.org/docs/latest/build.html

Upvotes: 1

Hoh
Hoh

Reputation: 1184

To add a reference in Visual Basic
In Solution Explorer, double-click the My Project node for the project.
In the Project Designer, click the References tab.
Click the Add button to open the Add Reference dialog box.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, and then click OK.

To add a reference in Visual C#
In Solution Explorer, right-click the project node and click Add Reference.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, and then click OK.

To add a reference in Visual C++
In Solution Explorer, select the project. On the Project menu, click Add References.

Note In Visual C++ 2005, click References on the Project menu, and then click Add New Reference. In the Add References dialog box, click the tab that corresponds with the category that you want to add a reference to.

Note In Visual C++ 2005, click the Browse tab in the Add References dialog box. Click Browse, locate the component that you want on your local drive, and then click OK. The component is added to the Selected Components field.

Note In Visual C++ 2005, locate the component that you want on your local drive. To add the selected reference to the current tab, click Add.

Note In Visual C++ 2005, click OK to close the dialog box and add the component in the References list box on the Properties Page dialog box of the project.

More about this you can find HERE

Upvotes: 1

Hisham Sueyllam
Hisham Sueyllam

Reputation: 1

You need to specify the libraries for example glut.lib and the others to the project, The compiler cannot scan all libraries looking for the functions you are invoking; only does that for the standard library. So in VS from the project Menu select properties, then for the linker input add the libraries you are using to additional dependencies.

Upvotes: 0

Related Questions