Unresolved external symbols in OGL

This is a discussion on Unresolved external symbols in OGL within the Game Programming forums, part of the General Programming Boards category; I have an opengl program that does not work because I am getting unresolved external symbol errors. Here are the ...

  1. #1
    Shadow12345
    Guest

    Unresolved external symbols in OGL

    I have an opengl program that does not work because I am getting unresolved external symbol errors. Here are the errors:
    [errors]
    --------------------Configuration: opengl - Win32 Debug--------------------
    Compiling...
    main.cpp
    Linking...
    main.obj : error LNK2001: unresolved external symbol _gluPerspective@32
    main.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
    main.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
    main.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
    main.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
    main.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
    main.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
    main.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
    main.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
    main.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
    main.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
    main.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
    main.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
    main.obj : error LNK2001: unresolved external symbol __imp__glClear@4
    Debug/opengl.exe : fatal error LNK1120: 14 unresolved externals
    Error executing link.exe.

    opengl.exe - 15 error(s), 0 warning(s)
    [/code]

    The headers I included are:
    #include <windows.h>
    #include <gl/gl.h>
    #include <gl/glu.h>
    #include <gl/glaux.h>

    I am pretty sure I included all the correct headers, and yes they are all in the correct location (in the gl folder in my include directory).

    I am honestly not sure why I am getting all of these errors, is there some project setting I must change in visual studio before i continue?
    Thanks if you can help me!
    Catch you later.

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    you have to link to the libraries,

    OpenGL32.lib/OpenGL.lib
    Glu32.lib/Glu.lib

    and Glaux.lib
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Shadow12345
    Guest
    Yeah, how silly of me! I didn't even have the libraries, I had to download them from www.opengl.org.

    Anyways, it only supplised 3 libraries:
    Glu32.lib, GlAux.lib, and Gl.lib

    Does anyone know where the DEVMODE structure should be put (for fullscreen) in an application? Does it even matter just as long as it is before the window is shown or created?

  4. #4
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    though im not entirely sure of your meaning, i'll try anyway.

    it depends on what you plan to do with it, but for the most part as far a i know it doesn't matter?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  5. #5
    Shadow12345
    Guest
    Well thanks for trying, I will just fool around with it until I find something that works!

    Take care

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 02-02-2009, 07:27 AM
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 01:13 AM
  4. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  5. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21