Results 1 to 4 of 4

Thread: Some new errors

  1. #1
    Guest

    Some new errors

    Hello. I'm trying to compile "Red Book" code samples in VC++ 6, but it gives me that errors:

    C:\Archivos de programa\Microsoft Visual Studio\MyProjects\test2\test1.cpp(41) : error C2664: 'auxReshapeFunc' : cannot convert parameter 1 from 'void (int,int)' to 'void (__stdcall *)(int,int)'
    None of the functions with this name in scope match the target type
    C:\Archivos de programa\Microsoft Visual Studio\MyProjects\test2\test1.cpp(42) : error C2664: 'auxMainLoop' : cannot convert parameter 1 from 'void (void)' to 'void (__stdcall *)(void)'
    None of the functions with this name in scope match the target type

    ¿some ideas?

    ----------------------------

    The source code is: (viewing chapter)

    void display (void)
    {
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f (1.0, 1.0, 1.0);
    glLoadIdentity (); /* clear the matrix */
    glTranslatef (0.0, 0.0, -5.0); /* viewing transformation */
    glScalef (1.0, 2.0, 1.0); /* modeling transformation */
    auxWireCube(1.0); /* draw the cube */
    glFlush();
    }

    void myinit (void)
    {
    glShadeModel (GL_FLAT);
    }

    void myReshape(GLsizei w, GLsizei h)
    {
    glMatrixMode (GL_PROJECTION); /* prepare for and then */
    glLoadIdentity (); /* define the projection */
    glFrustum (-1.0, 1.0, -1.0, 1.0, /* transformation */
    1.5, 20.0);
    glMatrixMode (GL_MODELVIEW); /* back to modelview matrix */
    glViewport (0, 0, w, h); /* define the viewport */
    }


    int main(int argc, char** argv)
    {
    auxInitDisplayMode (AUX_SINGLE | AUX_RGBA);
    auxInitPosition (0, 0, 500, 500);
    auxInitWindow (argv[0]);
    myinit ();
    auxReshapeFunc (myReshape);
    auxMainLoop(display);
    }

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: Some new errors

    You must have an old opengl red book, the newer versions have replaced the old glaux.lib with glut.lib.

    I think your problem could be the glaux.lib you have, it could be compiled for a older version of VC or the wrong version of the glaux.h.

    Best not to use the glaux since it is no longer supported, convert the examples to the glut version of the glaux commands.

    Here is a link to the newer version of the opengl red book that is on-line: http://ask.ii.uib.no/ebt-bin/nph-dwe...ew;cs=fullhtml


    Originally posted by McOwen:
    Hello. I'm trying to compile "Red Book" code samples in VC++ 6, but it gives me that errors:

    C:\Archivos de programa\Microsoft Visual Studio\MyProjects\test2\test1.cpp(41) : error C2664: 'auxReshapeFunc' : cannot convert parameter 1 from 'void (int,int)' to 'void (__stdcall *)(int,int)'
    None of the functions with this name in scope match the target type
    C:\Archivos de programa\Microsoft Visual Studio\MyProjects\test2\test1.cpp(42) : error C2664: 'auxMainLoop' : cannot convert parameter 1 from 'void (void)' to 'void (__stdcall *)(void)'
    None of the functions with this name in scope match the target type

    ¿some ideas?


  3. #3
    Guest

    Re: Some new errors

    Yes,you are right. I have no problems when usign glut library.
    Thanks for your help!

  4. #4
    Member Contributor
    Join Date
    Aug 2001
    Location
    Berkeley, Ca., USA
    Posts
    52

    Re: Some new errors

    If I'm remembering error messages properly the problem is that the code in your glAux library is using standard C mangling on the names but your compiler is probably defaulting to C++... you can enclose your example code in an extern "c" {} block, or adjust the settings of your compiler to mangle the names differently. (Somewhere under project settings in VC++).

Similar Threads

  1. Xsd.exe errors?
    By pekkah in forum COLLADA
    Replies: 22
    Last Post: 09-12-2008, 04:55 PM
  2. Replies: 0
    Last Post: 11-09-2005, 10:24 PM
  3. errors in gl.h lib
    By in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 01-13-2005, 10:55 AM
  4. errors...
    By Vincent_dup1 in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-28-2004, 03:36 PM
  5. Errors..
    By Nial in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-25-2002, 05:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean