Problems #include'ing a file

G

Guest

I am working on developing a program using Visual Studio 2003 but am having
problems getting my program to find my GL.h and GLU.h, and I am guessing it
will have the same problems trying to link to the .lib and .dll files. What
do I all need to do to get this to properly compile and link. Here is what I
have done so far.

Inside my main project directory, I added a folder called "OpenGL" and
inside this folder are 3 sub-folders, "include", "lib", "bin" with the .h
files going into include, the .lib files into lib and the .dll files into bin.

I right-clicked onto my project and clicked on "Properties". In the left
list, I clicked on C\C++ and then on the sub-option "General". On the
"Additional Include Directories" I added the path
"$(ProjectDir)\OpenGL\include" to the listing. Then on the Linker option, I
added 2 paths to the "Additional Library Directories" with
"$(ProjectDir)\OpenGL\bin" and "$(ProjectDir)\OpenGL\lib".

But after doing this and cleaning my project and re-compiling, I get a whole
bunch of compiler errors saying "fatal error C1083: Cannot open include file:
'GL.h': No such file or directory". I have in my .h file added the line:

#include "GL.h"
#include "GLU.h"

Does anyone have any ideas on what else I need to do to be able to include
these files into my project? Thanks!
 
G

Guest

Todd Dobmeyer said:
I am working on developing a program using Visual Studio 2003 but am having
problems getting my program to find my GL.h and GLU.h, and I am guessing it
will have the same problems trying to link to the .lib and .dll files. What
do I all need to do to get this to properly compile and link. Here is what I
have done so far.

Inside my main project directory, I added a folder called "OpenGL" and
inside this folder are 3 sub-folders, "include", "lib", "bin" with the .h
files going into include, the .lib files into lib and the .dll files into bin.

I right-clicked onto my project and clicked on "Properties". In the left
list, I clicked on C\C++ and then on the sub-option "General". On the
"Additional Include Directories" I added the path
"$(ProjectDir)\OpenGL\include" to the listing. Then on the Linker option, I
added 2 paths to the "Additional Library Directories" with
"$(ProjectDir)\OpenGL\bin" and "$(ProjectDir)\OpenGL\lib".

But after doing this and cleaning my project and re-compiling, I get a whole
bunch of compiler errors saying "fatal error C1083: Cannot open include file:
'GL.h': No such file or directory". I have in my .h file added the line:

#include "GL.h"
#include "GLU.h"

Does anyone have any ideas on what else I need to do to be able to include
these files into my project? Thanks!

Well I found that I already had GLU.h inside my VisualStudio directory
located at "C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\gl" but unfortunately, I cannot get it to find
this .h file. I have just used the statement

#include "GLU.h"

and it says it cannot open the include file. What do I need to do to find
the one include with my Visual Studio install? Thanks again!
 
G

Guest

#include "GLU.h"

and it says it cannot open the include file. What do I need to do to find
the one include with my Visual Studio install? Thanks again!

I am a moron...I needed

#include <gl\glu.h>
 
G

Guest

You might need to see if the Include directories is correctly set under
Tool->Options
->Projects and Solutions->VC++ Directories.

you might need to that include path as well.

Thanks
JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top