   OpenGL 2.1 & MinGW
  Hi, i wonder if anyone had this problem before...I'm using MinGW to learn OpenGL, and when i tryed to use the glSecondaryColor3ub(...) function, i notice that my OpenGL header and .a files were outdated... very, i was using the 1.2 version, and so i started to search for some updated headers and .a files, but with no success. Can anyone tell me were can i find updated headers and .a files for MinGW ?Thanks for any help :)   
  You only need to add "glext.h" from opengl.org. It is nothing to do with MinGW nor libraries(*.a). But, you have to get the extensions (function pointers) from the video drivers.[ADDED]See the bottom of the following page for the usage of OpenGL extensions:http://www.opengl.org/wiki/index.php/Getting_started;  I would suggest using GLEW. I have no problems using the newer stuff with MinGW and GLEW.   ;  well, i did added the new glext.h but the glSecondaryColor3ub(...) is still not recognized by mingw compiler...E:\Users\Claymore\Desktop\OpenGL\MyProgram>g++ -o MyOpenGL main.cpp -lGLUT32 -lGLAUX -lGLU32 -lOPENGL32main.cpp: In function `void mydisplay()':main.cpp:75: error: `glSecondaryColor3ub' undeclared (first use this function)main.cpp:75: error: (Each undeclared identifier is reported only once for each function it appears in.)the most weird is that the glEnalbe(GL_COLOR_SUM); is recognized... :Sthe glext.h is in the MinGW/include/GL directory and there's an include in the program code.i don't understand what is the problem :S;  You need an extension loader, the libs that come with MingW only have entry points for the MS provided opengl32.dll.  Grab either GLee or GLEW from: http://www.opengl.org/sdk/libs/.  Full glext.h is also available there.  You could write one yourself, but no need really.   ;  yes but glew only has lib files for MSVC, it doesn't have for MinGW :Show to solve this, does anyone knows ?!?   ;  If you have a working GLEW and use a glewInit(), then are you checking to see if that function is supported?   ;  Well, i solved the "glew for MinGW" problem, i compiled an MinGW version with MSys tools, but now i have another problem :S :S, the program compiles just fine, glSecondaryColor3ub(...) is recognised but the problem is, if i have that function in the code, the program simply crashes :S and i don't know why :Si have the glewinit() in the main code blockThis is the output of my program with the compile options...remember, i'm learning OpenGL so i don't have crazy makefiles, just a simple batch :)E:\Users\Claymore\Desktop\OpenGL\MyProgram>Compile.batE:\Users\Claymore\Desktop\OpenGL\MyProgram>g++ -o MyOpenGL main.cpp -lGLEW32  -lGLUT32 -lGLAUX -lGLU32 -lOPENGL32E:\Users\Claymore\Desktop\OpenGL\MyProgram>MyOpenGL.exeGL_MAX_MODELVIEW_STACK_DEPTH->32GL_MAX_PROJECTION_STACK_DEPTH->10GL_MAX_TEXTURE_STACK_DEPTH->10GL_VENDOR -> ATI Technologies Inc.GL_RENDERER -> ATI MOBILITY RADEON 9600/9700 Series (Omega 3 x86/SSE2GL_VERSION -> 2.0.6458 WinXP ReleasePs: I noticed that the OpenGL version is the 2.0 WinXP Release, i'm still trying to figure out why when i installed the Ati Drivers, the OpenGL 2.1 ATI version wasn't installed... but since the glSecondaryColorub() is a 1.4 OpenGL version function, there shouldn't be any problems...   ;  Well if you can't solve it yourself, and its not a very sensitive project, post/link/ or PM me the source and I'll see if I can solve it.   ;  It's just learning code, nothing much... it's just a test filesorry about the portuguese comments, and sorry if i don't use special tags for the code, i simply don't know how to use them because in the posting area, there are no shortcuts for that :Sthanks for any help :)#include <GL/glew.h>#include <GL/glut.h>//#include <GL/gl.h>//#include <GL/glu.h>//#include <GL/glext.h>#include <iostream>#include <stdio.h>#define Res_Width 1024#define Res_Heigth 768using namespace std;//Coordenadas para cada janela de visualizaçãoGLdouble PDistancia, Pcenterx, Pcentery,  Protatex, Protatey, Protatez; //Perspectiva normalGLdouble YoZeyex, YoZeyey, YoZeyez, YoZcenterx, YoZcentery, YoZcenterz; //YoZGLdouble XoZeyex, XoZeyey, XoZeyez, XoZcenterx, XoZcentery, XoZcenterz; //XoZGLdouble YoXeyex, YoXeyey, YoXeyez, YoXcenterx, YoXcentery, YoXcenterz; //YoX// Mouse Stuffint mousex,mousey; //Coordenadas do Mouseint mousebutton;   //Mouse Buttonint mousestate;    //Mouse Statevoid mydisplay(){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);/* clear the display */  glPolygonMode(GL_FRONT, GL_LINE); //Desenhar como Wireframe  glPolygonMode(GL_BACK, GL_LINE);    for (int x=0;x<4;x++){    glMatrixMode(GL_PROJECTION);    glEnable(GL_COLOR_SUM);   glLoadIdentity();    gluPerspective(90.0,4.0/3.0,0.0,300.0);    if(x==0){ //Perspectiva normal glTranslated(Pcenterx,Pcentery,-PDistancia); glRotated(Protatex,1.0,0.0,0.0); glRotated(Protatey,0.0,1.0,0.0); glRotated(Protatez,0.0,0.0,1.0);  glViewport(0,(Res_Heigth/2 - 1),Res_Width/2,Res_Heigth/2);  }    else if(x==1){ //YoZ gluLookAt(YoZeyex,YoZeyey,YoZeyez,YoZcenterx,YoZcentery,YoZcenterz,0.0,1.0,0.0); glViewport((Res_Width/2 - 1),0,Res_Width/2,Res_Heigth/2);}    else if(x==2){ //XoZ gluLookAt(XoZeyex,XoZeyey,XoZeyez,XoZcenterx,XoZcentery,XoZcenterz,1.0,0.0,0.0); glViewport((Res_Width/2 - 1),(Res_Heigth/2 - 1),Res_Width/2,Res_Heigth/2);}    else{//YoX    gluLookAt(YoXeyex,YoXeyey,YoXeyez,YoXcenterx,YoXcentery,YoXcenterz,0.0,1.0,0.0); glViewport(0,0,Res_Width/2,Res_Heigth/2);}  glMatrixMode(GL_MODELVIEW);glLoadIdentity();    glBegin(GL_LINES); //Desenha o Eixo (3D) glColor3f(255, 0, 0); //Eixo XX glVertex3f(0.0, 0.0, 0.0);   glVertex3f(10.0, 0.0, 0.0); glColor3f(0, 255,0 ); //Eixo YY glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 10.0, 0.0); glColor3f(0, 0, 255); //Eixo ZZ glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 0.0, 10.0);   glEnd();glBegin(GL_TRIANGLE_STRIP); glColor3f(255, 0, 0); glSecondaryColor3ub(255,0,0); glVertex3f(30.0, 50.0, -20.0); glVertex3f(30.0, 50.0, 0.0); glVertex3f(50.0, 50.0, -20.0); glVertex3f(50.0, 50.0, 0.0); glVertex3f(50.0, 30.0, -20.0); glVertex3f(50.0, 30.0, 0.0); glVertex3f(30.0, 30.0, -20.0); glVertex3f(30.0, 30.0, 0.0); glVertex3f(30.0, 50.0, -20.0); glVertex3f(30.0, 50.0, 0.0);    glEnd();    }  glutSwapBuffers();  }void DisplayOverlay(){    cout << "glutDisplay" << endl;}void MyKey(unsigned char key,int x, int y){    if (key == 'q'){    cout << "Last Error-> " << glGetError();   exit(0);    }    else if (key == 'r'){    //Reset aos valores PDistancia=70.0; Pcenterx=0.0; Pcentery=0.0; Protatex=45.0; Protatey=-45.0; Protatez=0.0; //Perspectiva normal YoZeyex= -70.0; YoZeyey=0.0; YoZeyez=0.0;YoZcenterx=0.0; YoZcentery=0.0; YoZcenterz=0.0; //YoZ XoZeyex=0.0; XoZeyey=70.0; XoZeyez=0.0; XoZcenterx=0.0; XoZcentery=0.0; XoZcenterz=0.0; //XoZ YoXeyex=0.0; YoXeyey=0.0; YoXeyez=70.0; YoXcenterx=0.0; YoXcentery=0.0; YoXcenterz=0.0; //YoX mydisplay();    }    else{ cout << key << endl;}}void MyMouseActive(int x, int y){  GLdouble acel_x, acel_y;  if (mousebutton != GLUT_LEFT_BUTTON && mousebutton != GLUT_RIGHT_BUTTON && mousebutton != GLUT_MIDDLE_BUTTON){    return;  }  acel_x = (mousex-x)/(Res_Width/2.0);  acel_y = (y-mousey)/(Res_Heigth/2.0);  if (mousebutton == GLUT_LEFT_BUTTON){if (x<(Res_Width/2 - 1) && y>(Res_Heigth/2 - 1) && mousex<(Res_Width/2 - 1) && mousey>(Res_Heigth/2 - 1)){ //YoX YoXeyex+=acel_x; YoXeyey+=acel_y; YoXcenterx+=acel_x; YoXcentery+=acel_y;}    else if (x<(Res_Width/2 - 1) && y<(Res_Heigth/2 - 1) && mousex<(Res_Width/2 - 1) && mousey<(Res_Heigth/2 - 1)){ //Perspectiva NormalPcenterx+=acel_x; Pcentery+=acel_y;}    else if (x>(Res_Width/2 - 1) && y>(Res_Heigth/2 - 1) && mousex>(Res_Width/2 - 1) && mousey>(Res_Heigth/2 - 1)){ //YoZ YoZeyey+=acel_y; YoZeyez+=acel_x; YoZcentery+=acel_y; YoZcenterz+=acel_x;    }    else if (x>(Res_Width/2 - 1) && y<(Res_Heigth/2 - 1) && mousex>(Res_Width/2 - 1) && mousey<(Res_Heigth/2 - 1)){ //XoZ XoZeyex+=acel_y; XoZeyez+=acel_x; XoZcenterx+=acel_y;XoZcenterz+=acel_x;}    }  else if (mousebutton == GLUT_RIGHT_BUTTON){    if (x<(Res_Width/2 - 1) && y>(Res_Heigth/2 - 1) && mousex<(Res_Width/2 - 1) && mousey>(Res_Heigth/2 - 1)){ //YoX  YoXeyez+=acel_y; YoXcenterz+=acel_y;}    else if (x<(Res_Width/2 - 1) && y<(Res_Heigth/2 - 1) && mousex<(Res_Width/2 - 1) && mousey<(Res_Heigth/2 - 1)){ //Perspectiva Normal Protatex+=acel_y; Protatey-=acel_x;    }    else if (x>(Res_Width/2 - 1) && y>(Res_Heigth/2 - 1) && mousex>(Res_Width/2 - 1) && mousey>(Res_Heigth/2 - 1)){ //YoZ YoZeyex-=acel_y; YoZcenterx-=acel_y;}    else if (x>(Res_Width/2 - 1) && y<(Res_Heigth/2 - 1) && mousex>(Res_Width/2 - 1) && mousey<(Res_Heigth/2 - 1)){ //XoZ XoZeyey+=acel_y; XoZcentery+=acel_y;}    }else if (mousebutton == GLUT_MIDDLE_BUTTON){    if (x<(Res_Width/2 - 1) && y<(Res_Heigth/2 - 1) && mousex<(Res_Width/2 - 1) && mousey<(Res_Heigth/2 - 1)){ //Perspectiva Normal Protatez+=acel_x; PDistancia+=acel_y;}  }  mydisplay();  }void MyMousePress(int button, int state, int x, int y){    mousex = x;    mousey = y;    mousebutton = button;    mousestate = state;if(!state){ glutSetCursor(GLUT_CURSOR_INFO);    }    else{ glutSetCursor(GLUT_CURSOR_RIGHT_ARROW);    } }int main (int argc, char **argv){    int i, wd;    glewInit();glutInit(&argc, argv);    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE |GLUT_DEPTH | GLUT_STENCIL);    glutInitWindowSize(1024,768);    wd = glutCreateWindow("Main Window");    glutDisplayFunc(mydisplay);//Callbacks    //glutOverlayDisplayFunc(DisplayOverlay);    glutKeyboardFunc(MyKey);    glutSetWindow(wd);    //glutPassiveMotionFunc(MyMouseInactive);    glutMotionFunc(MyMouseActive);    glutMouseFunc(MyMousePress);    glutFullScreen();    //gluOrtho2D(0,1024,0,768);/* how object is mapped to window */    //glOrtho(-512.0, 512.0, -384.0, 384.0, 100.0, -100.0);//    gluPerspective(130.0,4.0/3.0,10.0,20.0);double x,y,z,w;    glGetDoublev(GL_MAX_MODELVIEW_STACK_DEPTH,&x);    glGetDoublev(GL_MAX_PROJECTION_STACK_DEPTH,&y);    glGetDoublev(GL_MAX_TEXTURE_STACK_DEPTH,&w);    cout << "GL_MAX_MODELVIEW_STACK_DEPTH->" << x << endl;    cout << "GL_MAX_PROJECTION_STACK_DEPTH->" << y << endl;   cout << "GL_MAX_TEXTURE_STACK_DEPTH->" << w << endl; cout << "GL_VENDOR -> " << glGetString(GL_VENDOR) << endl;    cout << "GL_RENDERER -> " << glGetString(GL_RENDERER) << endl;    cout << "GL_VERSION -> " << glGetString(GL_VERSION) << endl;   cout << "GL_EXTENSIONS -> " << glGetString(GL_EXTENSIONS) << endl;  //Inicializar os valores    PDistancia=70.0; Pcenterx=0.0; Pcentery=0.0;Protatex=45.0; Protatey=-45.0; Protatez=0.0; //Perspectiva normalYoZeyex= -70.0; YoZeyey=0.0; YoZeyez=0.0; YoZcenterx=0.0; YoZcentery=0.0; YoZcenterz=0.0; //YoZ    XoZeyex=0.0; XoZeyey=70.0; XoZeyez=0.0; XoZcenterx=0.0; XoZcentery=0.0; XoZcenterz=0.0; //XoZ    YoXeyex=0.0; YoXeyey=0.0; YoXeyez=70.0; YoXcenterx=0.0; YoXcentery=0.0; YoXcenterz=0.0; //YoX    glutMainLoop();   return 0;}