PDA

View Full Version : problem with OpenGL superbible book (6th edition)



Kalir44
08-08-2014, 01:30 PM
Hi, i started read this book ( OpenGL superbible: Comprehensive Tutorial and reference (6th edition) ) but, at the first soucre code:
// Include the "sb6.h" header file
#include "sb6.h"
// Derive my_application from sb6::application
class my_application : public sb6::application
{
public:
// Our rendering function
void render(double currentTime)
{
// Simply clear the window with red
static const GLfloat red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glClearBufferfv(GL_COLOR, 0, red);
}
};
// Our one and only instance of DECLARE_MAIN
DECLARE_MAIN(my_application);

i have an error in sb6.h it doesnt exists. so, i have downloaded a sb6 folder ( https://github.com/openglsuperbible/sb6code ) but i dont know, how to install it? I tryed to move all includes to my include folder (C://Microsoft VisualStudio 2010//VC//include

but now, iam getting about 20 link errors.

btw. i tried to start the sb6 in visual studio and click "F7" but, 1 suceeded, 73 failed. the error for that is "Specified platform toolset (v120) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected."

Agent D
08-08-2014, 02:43 PM
This issue has been posted multiple times already. Apparently the sample source does not include the headers and libaries.

A few hints:


You don't move header files to the visual studio include directoy. Also, you don't move libraries to system32. The header files go to a subdirectory in the project directory. MSVC and other IDEs have compiler include directory configurations. Same goes for libraries.
You get linker errors beacuse the functions declared by sb6.h are defined in some library that you are still missing
A header file normally doesn't contain function definitions, you don't compile and run a header file.
It is adviseable to study the C programming language that you decided to use at frist instead of immedately jumping at OpenGL(R) while learning C at the same time

Kalir44
08-08-2014, 02:58 PM
So, which one libraries are still missing? I dont know :/

Is there anyone, who rode that book?

Agent D
08-09-2014, 08:39 AM
The sb6 library. Compiling the sb6 solution should generate the sb6 library along with the book samples (is that the one that sb6 that you tried to compile?). If so, the error message above propably referes to the Windows(R) platfrom SDK. You might want to install it anyway.

Kalir44
08-09-2014, 12:15 PM
I can build only a sb6. So, ok, i have "fixed" it, that linkers errors are there only when iam using a empty project(new project->emptyproject) but, if i am using win32 project, it works, without errors. :D

but, i released that program, and on another PC, i can not start that program. why?

Agent D
08-10-2014, 02:30 AM
msvcrtXX.dll missing?
wrong architecture?

My crystal ball is cloudy today. Would you mind posting an error message?

Kalir44
08-10-2014, 05:30 AM
There is not an error message. If you start that programm, on your screen will appear for about 1-2 seconds a window with title: GLFW window, its empty window, and after 1-2 seconds, it disappears. :D On my PC the GLFW window appears too, but for about 10-20ms and after that the prgoramm window appears.

btw. it looks like a all bugged for me :D i downloaded some examples, and when i am debugging them, that programm is only black, there is not that example what i choosed (tunnel, or startfield)

Kalir44
08-11-2014, 05:12 AM
I dont know, but GLFW means something with a OpenGL window :D maybe its a problem in a drivers. On anothers PC i have very old components. Is here anyone, who have updated his graphic card, and its compatible with OpenGL 4.3? If yes, Can you try if that program works for you?:) :D the link is https://mega.co.nz/#!a9hSnTAB!3dQq-nTEl2G766RYRaROXtMLkeFvfxdYut0YbRlEi6k .

Kalir44
08-19-2014, 04:52 AM
So? noone wants to try that for me..?:D