Dear Ladies and gentleman,
I have installed your OpenSG in the version 1.8.0. 1. Now I want to
start running your program 01firstapp.cpp in eclipse in linux debian. So
I have startet there a new managed c++ project and have include the file
01firstapp.cpp in this project. In the compiler options I have include
the subdirectory GLUT. If I start then the cimpiling of your program I
get the following error message
**** Build of configuration Debug for project testOpenSG ****
make -k all
Building file: ../firstapp.cpp
Invoking: GCC C++ Compiler
g++ -I/home/sheyer/Desktop/Home/Programme/OpenSG/OpenSG/Source/WindowSystem/GLUT -O0 -g3 -Wall -c -fmessage-length=0
-MMD -MP -MF"firstapp.d" -MT"firstapp.d" -o"firstapp.o" "../firstapp.cpp"
../firstapp.cpp: In function ‘int main(int, char**)’:
../firstapp.cpp:30: error: ‘GLUTWindowPtr’ was not declared in this scope
../firstapp.cpp:30: error: expected `;' before ‘gwin’
../firstapp.cpp:31: error: ‘gwin’ was not declared in this scope
make: *** [firstapp.o] Fehler 1
make: Das Target »all« wurde wegen Fehlern nicht aktualisiert.
Build complete for project testOpenSG
Please can you tell me what I have do wrong, so that the program is running.
With best wishes and thanks,
Stefan Heyer
--
Dipl.-Math. Stefan Heyer
Institute of Automation (IAT)
University of Bremen
Otto-Hahn-Allee, NW1, Room N1151
28359 Bremen, Germany
Phone +49-421-218-2442
Fax +49-421-218-4596
eMail [EMAIL PROTECTED]
//what follows here is the smallest OpenSG programm possible
//most things used here are explained now or on the next few pages, so don't
//worry if not everythings clear right at the beginning...
//Some needed inlcude files - these will become more, believe me ;)
#include <OpenSG/OSGConfig.h>
#include <OpenSG/OSGGLUT.h>
#include <OpenSG/OSGSimpleGeometry.h>
#include <OpenSG/OSGGLUTWindow.h>
#include <OpenSG/OSGSimpleSceneManager.h>
//In most cases it is useful to add this line, else every OpenSG command
//must be preceeded by an extra OSG::
OSG_USING_NAMESPACE
//The SimpleSceneManager is a little usefull class which helps us to
//manage simple configurations. It will be discussed in detail later on
SimpleSceneManager *mgr;
//we have a forward declarion here, just to sort the code
int setupGLUT( int *argc, char *argv[] );
int main(int argc, char **argv)
{
// Init the OpenSG subsystem
osgInit(argc,argv);
// We create a GLUT Window (that is almost the same for most applications)
int winid = setupGLUT(&argc, argv);
GLUTWindowPtr gwin= GLUTWindow::create();
gwin->setId(winid);
gwin->init();
// That will be our whole scene for now : an incredible Torus
NodePtr scene = makeTorus(.5, 2, 16, 16);
// Create and setup our little friend - the SSM
mgr = new SimpleSceneManager;
mgr->setWindow(gwin );
mgr->setRoot (scene);
mgr->showAll();
// Give Control to the GLUT Main Loop
glutMainLoop();
return 0;
}
// react to size changes
void reshape(int w, int h)
{
mgr->resize(w, h);
glutPostRedisplay();
}
// just redraw our scene if this GLUT callback is invoked
void display(void)
{
mgr->redraw();
}
//The GLUT subsystem is set up here. This is very similar to other GLUT
//applications If you have worked with GLUT before, you may have the feeling
//of meeting old friends again, if you have not used GLUT before that is no
//problem. GLUT will be introduced briefly in the next section.
int setupGLUT(int *argc, char *argv[])
{
glutInit(argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
int winid = glutCreateWindow("OpenSG First Application");
glutDisplayFunc(display);
glutReshapeFunc(reshape);
return winid;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users