I'm working on the opengl tutorial, but my stystem is unable to find this header?
where can i get this?
Printable View
I'm working on the opengl tutorial, but my stystem is unable to find this header?
where can i get this?
stdafx is some piece of junk VC++ automatically creates to "manage" pre-compiled headers.
It never contains anything worth looking at
it is an include file under the opengl tutorial.
code referenced from link
If it is not valid, then why is it listed in the tutorial?Code:
/* Pre-processor directives*/
#include "stdafx.h"
#include <windows.h>
I'm confused.
It does work with out it, so i'm really confused now.
Have you tried using #include <stdafx.h>? I might find it there.
Try changing it to
// #include "stdafx.h"
Like I said, it's a windows compiler "optimisation" thing.
stdafx.h is just a pregenerated file that contains commonly used headers. It contains nothing itself apart from other #includes. It's a nice feature when using MFC because you don't have to remember which headers to include, but if I'm not using MFC I usually just remove all references to it.
now I'm having (unresolved externals) with the robot program.
is it posted without a required header?
i'm assuming from these errors the program is not a self contained program. Do I have to create the prototypes or the entire class? looking at the program it looks like it should work asis due to the functions are declared prior to main. I'm not sure what is wrong. could it be the function calls are passing the wrong type of data? Sorry if these question are remedial, but I've never seen open gl or windows programming before.link
Unresolved externals are linker errors, not compiler errors. You most likely need to like the OpenGL libraries.
You also need to link with the opengl library
How you do this depends on your compiler
With gcc for example, you would do something like
gcc prog.c -lopengl
With an IDE, there's usually a project setting to specify names/locations of additional libraries
I've read that this is how you link the library, but I do not have this option on my compiler. I'm using
Microsoft Visual C++.NET Version 7.0.9466
Does anybody know how to do this on my compiler.
details quoted from linkQuote:
After you have created a new Win32 Application (NOT a console application) in Visual C++, you will need to link the OpenGL libraries. In Visual C++ go to Project, Settings, and then click on the LINK tab. Under "Object/Library Modules" at the beginning of the line (before kernel32.lib) add OpenGL32.lib GLu32.lib and GLaux.lib. Once you've done this click on OK. You're now ready to write an OpenGL Windows program.
I created the win32 application, I assumed it needed to be an empty project. When I click on the project menu I get
(1) add class
(2) add resource
(3) add new item
(4) add existing item
(4) new folder
(5) add web reference
(6) set as startup project
I feel I'm in the wrong location.
On VC++ .NET, do the following:
Go to the solution explorer (the pane that has all your source files listed; use View->Solution Explorer if you don't see it).
You should see a tree view with your solution. The root of the tree is the solution, and the thing directly under the solution is your project (typically, if your solution contains only one project, it will have the same name as the solution itself).
Right click on the project, and select the "Properties" option from the menu that pops up.
In the new window that appears, click on "linker" then "input". Make sure, at the top, you select Configuration: All Configurations. Add your libraries (separated with spaces if there are multiple libraries) to the box saying "Additional Dependencies"
Cat,
Thanks for the help. :D I will try it at my next work break.
I saw that when tinkering, but was unsure what it meant.
The documentation provided by microsoft for the compiler wasn't clear on how to do it. I'm assuming you are fluent with the MSVC++.NET compiler. Do you have any recommendations on books to read on all the compiler options?
No, I just fought with it until I learned how it worked.
Thanks Cat.
It works.
You opened a new world of programming for me.
I feel OpenGL is going to be a fun experience.
I feel a bit smarter now.
:D :D :D :D
As another note, if you need different libraries for different configurations -- for example, if you need a debug version of the library in debug mode, and a release ver in release -- then set the libraries for each configuration separately, of course.