Sign in to follow this  
kelicant

Visual Studio Library linking problem

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
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
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
[size=4][font=arial, helvetica, sans-serif]Is there a GL\ folder in the [/font][/size]
[left][background=rgb(250, 251, 252)]dependencies\glew\include where the glew.h file is?[/background][/left]

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this