A bunch of compiler errors

This is a discussion on A bunch of compiler errors within the Game Programming forums, part of the General Programming Boards category; Hello, I'm writing a just a simple Window as my FIRST OpenGL program. Everything was going well until i finished ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    5

    A bunch of compiler errors

    Hello, I'm writing a just a simple Window as my FIRST OpenGL program. Everything was going well until i finished my last line of code, then i get this:

    LearnOPENGL error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glShadeModel@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z)
    LearnOPENGL error LNK2019: unresolved external symbol "long __stdcall WndProc(struct HWND__ *,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IJ@Z) referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z)
    LearnOPENGL fatal error LNK1120: 15 unresolved externals
    c:\Documents and Settings\Dimeslime\My Documents\Visual Studio Projects\LearnOPENGL\openglsample.cpp(383): warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
    LearnOPENGL error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
    LearnOPENGL error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)

    Sorry if that's a bit to much, but i can't seem to understand what's going on here, Am i missing a library? I'm using Visual Studio .NET. Not quite used to it yet..

    Thanks

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    ok you need to include windows.h before gl.h to prevent any errors there that might occur.

    your missing a lib for sure.
    and you need to link to the libs, OpenGL32.lib and Glu32.lib
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    5
    Yeah, i realize this now, I have the errors to just One now:


    LearnOPENGL error LNK2019: unresolved external symbol "long __stdcall WndProc(struct HWND__ *,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IJ@Z) referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z)

    But that's only because i included <glut.h>.

    #include <windows.h> // Header file forwindows
    #include <gl/GL.h> // Header file for the OpenGL32 Library
    #include <gl/GLU.h> // Header file for the GLu32 Library
    #include <gl/GLAux.h> // Header File for the GLaux Library
    #include <glut.h>

    Still getting the error.. Man.. FRUSTRATING!

  4. #4
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    link to the glut32.lib and glaux.lib .
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  5. #5
    Registered User
    Join Date
    Jul 2002
    Posts
    5
    Thanks man, finally got it.. linked them and it now works. This new visual studio is hard to get used to at first.
    Thanks again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Compiler Errors with Getline()
    By dac in forum C++ Programming
    Replies: 4
    Last Post: 11-16-2006, 10:58 AM
  3. Dev C++ Compiler, Indentation?
    By Zeusbwr in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 06:13 AM
  4. Compiler errors: no comprendo
    By CodeMonkey in forum C++ Programming
    Replies: 1
    Last Post: 12-29-2003, 03:39 AM
  5. Compiler errors
    By BellosX in forum C Programming
    Replies: 2
    Last Post: 09-21-2001, 03:24 AM

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