I am learning OpenGL and trying to run my first program. I have included all the files in include, lib, and bin folders. I have tried to add opengl32.lib;glut32.lib;glu32.li
The problem is from your LoadShaders
function not having a body (presumably from your LoadShaders.h). Either locate the .cpp for LoadShaders
, or link it's lib.
If LoadShaders has a lib, since you're using VS 2012, you can use a preprocessor directive to link your lib:
#pragma comment( lib, "yourlibfilename.lib" )
Make sure your lib is actually where you say it is. By default Visual Studio will assume the lib resides in the same folder as the default folder for the source files.
Only adding the libs in Linker->Input
is not enough. The Linker will still not find them because your libs are in some arbitrary directory. Add the directory they are in to the setting Linker->General->additional library directories
.
You're missing the lib (or cpp) file for that LoadShaders()
thing unless it's header only. Without knowing its contents we can't say that for sure.
Update:
The zip file with the book's source code includes everything you need.
You should do the following:
c:\openglbook\include
to "Include Directories".c:\openglbook\lib
to "Library Directories".Once this is done your project should build. If you're still lacking dependencies, like GLUT functions, add the apropriate library from the "lib" sub directory to the linker libraries list you already know.