Recently I started to learn OpenGL and; in turn, began to read the OpenGL SuperBible 6th edition, which uses OpenGL 4.3.
My problem is in the sb6.h header file, because in the book it was written that this is a c++ header file that defines a namespace called sb6 that includes the declaration of an application class.
When I try to compile my program, my C++ IDE(Visual Studio 2010) throws an error stating that such a header file cannot be found.
So maybe one of you heard about this problem or also started to read this book and knows how to fix this problem; if so please reply.
#include "sb6.h"
//derive my_application from sb6:application
class my_application : public sb6.application
{
public :
//Rendering function
void render(double currentTime){
//Simply clear the window red
static const GLfloat red[] = {1.0f , 0.0f , 0.0f , 1.0f};
glClearBufferfv(GL_COLOR, 0 , red) ;
}
the sb6.h file you are looking for is located at: https://github.com/openglsuperbible/sb6code/blob/master/include/sb6.h You can also navigate about that project and see the rest of the source/retrieve any other files you need. When you copy them to a local drive/directory make sure to add the path of the new directory containing headers to your include path and any libs to the lib path etc, as otherwise you will still meet the same error.
Well, unless you add them straight to the project dir (not recommended, as you will end up with massive repetition of content over all your gl projects, better to place them in one location and add the paths) Let me know if you need a hand with defining the paths.
Additional:
To include the headers, libs etc. just do the following:
Download all the sb6 project, then save somewhere (for example c:\sb6\
)
Then, go to Property Pages -> VC++ Directories -> Include Directories
and add the c:\sb6\include\
path here
then you will want to add the libraries via:
Property Pages -> VC++ Directories -> Library Directories
to here:
and finally add your source code directory via:
Property Pages -> VC++ Directories -> Source Directories
here:
To fix error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
This is normally a linker problem and most often happens from the wrong project type being selected (ie picking a windows program project and not a windows console one). It can be fixed by doing the following:
Go to Project -> Properties -> Configuration Properties -> Linker -> System
and on the entry for Subsystem
change it to Console
Shown here:
Let me know how you get on and I can expand if needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With