• Advertisement
Sign in to follow this  

Visual Studio Library linking problem

This topic is 2028 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

I've been going through tutorials for OpenGl for about 2 weeks now, I've gotten through all of them on 3 different websites. But now I'm trying to create an original project, and can't even get the project to work.

I start a new project in Visual Studio 2010. Win32 Console application, blank project. I add a main.cpp in the source folder.
Then I go to the projects properties, Linker>Input>Additional Dependencies and enter in opengl32.lib.

However my project is going to use glew, glfw, and glm. The way I understand linking the libraries is this:
Create a dependencies folder in my project directory (windows explorer)
Add the latest builds for glew, glfw, and glm in folder in directories by name (like a path of dependencies\glew\include)
Then go into the projects properties C C++>additional include directories and add
dependencies\glew\include
dependencies\glfw\include
dependencies\glm
Then go to Linker>Additional Library Directories and add
dependencies\glew\include
dependencies\glfw\lib-mscv100
Then go to Linker>Input>Additional Dependencies and add
glew32.lib
glfw.lib

And my code starts with


#include <stdio.h>
#include <stdlib.h>

#include <GL/glew.h>

#include <GL/glfw.h>

#include <glm/glm.hpp>
using namespace glm;

However it says "fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory".

Can anyone help me out? I've been trying everything imaginable for about 6 hours now. I'm frustrated out of my mind. Thanks for any input in advance.

Share this post


Link to post
Share on other sites
Advertisement
This is not a linker error, it's a compile error. You have not specified the include directory where GL/glew.h can be found.

Share this post


Link to post
Share on other sites
How would I go about doing that? I thought I went through all the steps?

Share this post


Link to post
Share on other sites
Project Properties->C/C++->General->"Additional Include Directories"
Enter the correct include path for the glew.h header and you should be good to go.

Share this post


Link to post
Share on other sites

[font=arial, helvetica, sans-serif]Is there a GL\ folder in the [/font]

[background=rgb(250, 251, 252)]dependencies\glew\include where the glew.h file is?[/background]



Full path being dependencies\glew\include\GL\glew.h Edited by Zoomulator

Share this post


Link to post
Share on other sites
Thanks for the help. The problem was there were 2 folders with the same name, it was in the wrong one.

Share this post


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

  • Advertisement