Results 1 to 7 of 7

Thread: compiling help please

  1. #1
    Guest

    compiling help please

    Having problems getting OpenGL to compile properly under VC++ .NET. I've included all the correct files and believe I have setup the linker correctly with opengl32.lib and glu32.lib. However, when I try to build every OpenGL call I make returns an undeclared identifier error, like it can't find the libraries. Any help with this would be greatly appreciated.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    586

    Re: compiling help please

    might be easier if you copy the the errors and post them.

    but, could be that you are trying to use functionality for OpenGL v1.2 or greater that exists only in extensions. The OpenGL libs and dlls only support thru v1.1 and all additional functionality exists in the drivers which you access as extensions using wglGetProcAddress. Information about extensions can be found here .


    [This message has been edited by shinpaughp (edited 06-28-2003).]

  3. #3
    Guest

    Re: compiling help please

    Ok here's what I'm including.

    #include <windows.h>
    #include <gl/gl.h>
    #include <gl/glu.h>
    #include <gl/glaux.h>

    then I added opengl32.lib and glu32.lib to the linker. I'm just testing the simple program in the beginning of the OpenGL Game Programming book. I'm using the libs and dlls provide with .NET.

    here are the errors:

    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(230): error C2065: 'GL_MODELVIEW' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(22: error C2059: syntax error : ')'
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(22: error C2146: syntax error : missing ')' before identifier 'width'
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(22: error C2065: 'GLfloat' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(22: error C2065: 'gluPerspective' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(225): error C2065: 'GL_PROJECTION' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(225): error C2065: 'glMatrixMode' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(224): error C2065: 'glViewport' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(195): error C2065: 'hwnd' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(96): error C2065: 'glEnd' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(93): error C2065: 'glVertex3f' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(92): error C2065: 'GL_TRIANGLES' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(92): error C2065: 'glBegin' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(91): error C2065: 'glColor3f' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(89): error C2065: 'glRotatef' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(8: error C2065: 'glTranslatef' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(83): error C2065: 'glLoadIdentity' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(82): error C2297: '|' : illegal, right operand has type ''unknown-type''
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(82): error C2296: '|' : illegal, left operand has type ''unknown-type''
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(82): error C2065: 'GL_DEPTH_BUFFER_BIT' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(82): error C2065: 'GL_COLOR_BUFFER_BIT' : undeclared identifier
    c:\Documents and Settings\Michael\My Documents\Visual Studio Projects\test\test.cpp(82): error C2065: 'glClear' : undeclared identifier

  4. #4
    Guest

    Re: compiling help please

    Just tried including glaux.lib and have tried glaux.dll, but that doesn't solve the problem either

  5. #5

    Re: compiling help please

    You need to include the Library directory with the -L switch, and include the .dll's individualy with -l switches.

    Also, I use
    #include <GL/gl.h>
    #include <GL/glu.h>
    #include <GL/glaux.h>

    with a capital GL. They are diferent libraries to the ones you yse. I don't know what the diference is, but the ones I use solved similar problems.

  6. #6
    Guest

    Re: compiling help please

    What do you mean with the -L and -l switches?? Also where do I specify directories to include? one last thing do the dll's go into additional dependencies just like the lib's do?

  7. #7
    Guest

    Re: compiling help please

    Alright guys. I was being a big, big idiot. Turns out I forgot to move stdafx.h to the top of the file. It works now . Thanks for the help though.

Similar Threads

  1. Compiling with gcc
    By in forum OpenGL: Linux
    Replies: 4
    Last Post: 09-06-2005, 02:53 PM
  2. Compiling in VC++
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-01-2003, 09:39 AM
  3. Compiling help
    By dromoz in forum OpenGL: Linux
    Replies: 3
    Last Post: 10-07-2002, 10:22 AM
  4. Compiling
    By lsigler in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-12-2001, 10:47 PM
  5. compiling with g++
    By amendola in forum OpenGL: Linux
    Replies: 9
    Last Post: 08-19-2001, 04:13 PM

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