rem: cout << "glutInit()..." <<  endl;
add: std::cout << "glutInit()..." <<  std::endl;
context: int main(int argc, char** argv){    cout << "osgInit()..." << endl;    osgInit( argc, argv );        cout << "glutInit()..." <<  endl;    glutInit( &argc, argv );    glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );    int winID = glutCreateWindow("OpenSG");        glutKeyboardFunc(key);    glutVisibilityFunc(vis);    glutReshapeFunc(resize);    glutDisplayFunc(display);           glutMouseFunc(mouse);       glutMotionFunc(motion);         glutIdleFunc(display);                glEnable( GL_DEPTH_TEST );    glEnable( GL_LIGHTING );    glEnable( GL_LIGHT0 );    glClearColor( .3, .3, .8, 1 );        cout << "Creating objects..." << endl;        //BEACON    NodePtr beaconNode = Node::create();    GroupPtr beaconCore = Group::create();    beginEditCP( beaconNode );    beaconNode->setCore( beaconCore );    endEditCP( beaconNode );        /*    //LIGHT    NodePtr dlightNode = Node::create();    DirectionalLightPtr dlightCore = DirectionalLight::create();    beginEditCP(dlightNode);    dlightNode->setCore(dlightCore);    endEditCP(dlightNode);        beginEditCP(dlightCore);    dlightCore->setAmbient( .3, .3, .3, 1 );    dlightCore->setDiffuse( .5, .5, .5, 1 );    dlightCore->setDirection( 0, 0 , 1 );    dlightCore->setBeacon( beaconNode );    endEditCP(dlightCore);    */            //TRANSFORM    NodePtr transNode = Node::create();    TransformPtr transCore = Transform::create();    beginEditCP( transNode );    transNode->setCore( transCore );    transNode->addChild( beaconNode );    endEditCP( transNode );    cam_trans = transCore;        //LOD    NodePtr lowDetailNode = makeBox( 1,1,1, 1,1,1 );    GeometryPtr boxCore = GeometryPtr::dcast(lowDetailNode->getCore());    SimpleMaterialPtr lowDetailMat = SimpleMaterial::create();    lowDetailMat->setDiffuse( Color3f( 1,0,0 ) );    lowDetailMat->setAmbient( Color3f( 1,0,0 ) );    boxCore->setMaterial( lowDetailMat );        NodePtr     medDetailNode = makeSphere( 1, 1 );    GeometryPtr medSphereCore = GeometryPtr::dcast(medDetailNode->getCore());    SimpleMaterialPtr medDetailMat = SimpleMaterial::create();    medDetailMat->setDiffuse( Color3f( 0,1,0 ) );    medDetailMat->setAmbient( Color3f( 0,1,0 ) );    medSphereCore->setMaterial( medDetailMat );        NodePtr highDetailNode = makeSphere( 2, 1 );    GeometryPtr highSphereCore = GeometryPtr::dcast(highDetailNode->getCore());    SimpleMaterialPtr highDetailMat = SimpleMaterial::create();    highDetailMat->setDiffuse( Color3f( 0,0,1 ) );    highDetailMat->setAmbient( Color3f( 0,0,1 ) );    highDetailMat->setSpecular( Color3f(1, 1, 1) );    highDetailMat->setShininess( 10 );    highSphereCore->setMaterial( highDetailMat );        NodePtr lodNode = Node::create();    DistanceLODPtr lodNodeCore = DistanceLOD::create();    beginEditCP(lodNode);    lodNode->setCore(lodNodeCore);    lodNode->addChild( highDetailNode );    lodNode->addChild( medDetailNode );    lodNode->addChild( lowDetailNode );    endEditCP(lodNode);        beginEditCP(lodNodeCore);    lodNodeCore->getSFCenter()->setValue( Pnt3f(0, 0, 0) );    lodNodeCore->getMFRange()->push_back( 4.0 );    lodNodeCore->getMFRange()->push_back( 8.0 );    lodNodeCore->getMFRange()->push_back( 11.0 );    endEditCP(lodNodeCore);                //TRANSFORM LOD    NodePtr transLODNode = Node::create();    TransformPtr transLODCore = Transform::create();    transMat.setTranslate( 1, -1, -1 );    beginEditCP(transLODCore);    transLODCore->getSFMatrix()->setValue( transMat );    endEditCP(transLODCore);    beginEditCP( transLODNode );    transLODNode->setCore( transLODCore );    transLODNode->addChild( lodNode );    endEditCP( transLODNode );                    //ROOT    root = Node::create();    GroupPtr rootCore = Group::create();    beginEditCP(root);    root->setCore(rootCore);    root->addChild(transNode);    root->addChild(transLODNode);    endEditCP(root);                camera = PerspectiveCamera::create();    beginEditCP(camera);    camera->setBeacon( beaconNode );    camera->setFov( deg2rad(90) );    camera->setNear( 0.1 );    camera->setFar( 10000 );    endEditCP(camera);        SolidBackgroundPtr background = SolidBackground::create();        viewp = Viewport::create();    beginEditCP(viewp);    viewp->setCamera( camera );    viewp->setBackground( background );    viewp->setRoot( root );    viewp->setSize( 0,0, 1,1 );    endEditCP(viewp);        GLint glVP[4];    glGetIntegerv( GL_VIEWPORT, glVP );        GLUTWindowPtr gwin = GLUTWindow::create();    gwin->setId(winID);    gwin->setSize(glVP[2], glVP[3]);        window = gwin;    beginEditCP(window);    window->addPort( viewp );    window->init();    endEditCP(window);        drAct = DrawAction::create();        Vec3f pos( 0, 0, 3 );    tball.setMode( Trackball::OSGObject );    tball.setStartPosition( pos, true );    tball.setSum( true );    tball.setTranslationMode( Trackball::OSGFree );    glutMainLoop();    return 0;}