Menu

Undefined ref error while compiling OpenGL

2007-12-08
2012-09-26
  • SSanfilippo

    SSanfilippo - 2007-12-08

    I've got Dev-Cpp 4.9.9.2 running on W32 (and I'm still noobish)
    While compiling my DLL, that should link to OpenGL, I receive the following error message.
    Everything seems OK...
    Is there anybody willing to tell my what on earth is happpening?

    (this is the entire log)

    Compiler: Default compiler
    Building Makefile: "C:Makefile.win"
    Executing make...
    make.exe -f "C:\Makefile.win" all
    dllwrap.exe --output-def ../../../Desktop/libAnalitica.def --implib ../../../Desktop/libAnalitica.a obj/Analitica.o obj/WinProc.o obj/CreaFinestra.o obj/DistruggiFinestra.o obj/InizializzaFinestra.o obj/OpenGL.o obj/Plotta.o obj/RidimensionaFinestra.o obj/WinMain.o obj/Main.o obj/Analitica_private.res -L"C:/Dev-Cpp/lib" --no-export-all-symbols --add-stdcall-alias --enable-stdcall-fixup -o ../../../Desktop/Analitica.dll

    Warning: resolving _ridimensionaFinestra@8 by linking to _ridimensionaFinestra
    Use --enable-stdcall-fixup to disable these warnings
    Use --disable-stdcall-fixup to disable these fixups
    Warning: resolving _distruggiFinestra by linking to _distruggiFinestra@0
    obj/CreaFinestra.o(.text+0x228):CreaFinestra.c: undefined reference to ChoosePixelFormat@8' obj/CreaFinestra.o(.text+0x297):CreaFinestra.c: undefined reference toSetPixelFormat@12'
    obj/CreaFinestra.o(.text+0x2e6):CreaFinestra.c: undefined reference to wglCreateContext@4' obj/CreaFinestra.o(.text+0x348):CreaFinestra.c: undefined reference towglMakeCurrent@8'

    obj/DistruggiFinestra.o(.text+0x16):DistruggiFinestra.c: undefined reference to wglMakeCurrent@8' obj/DistruggiFinestra.o(.text+0x26):DistruggiFinestra.c: undefined reference towglDeleteContext@4'
    obj/InizializzaFinestra.o(.text+0xe):InizializzaFinestra.c: undefined reference to glEnable@4' obj/InizializzaFinestra.o(.text+0x1d):InizializzaFinestra.c: undefined reference toglShadeModel@4'
    obj/InizializzaFinestra.o(.text+0x48):InizializzaFinestra.c: undefined reference to glClearColor@16' obj/InizializzaFinestra.o(.text+0x55):InizializzaFinestra.c: undefined reference toglClearDepth@8'
    obj/InizializzaFinestra.o(.text+0x64):InizializzaFinestra.c: undefined reference to `glEnable@4'

    obj/InizializzaFinestra.o(.text+0x73):InizializzaFinestra.c: undefined reference to glDepthFunc@4' obj/InizializzaFinestra.o(.text+0x8a):InizializzaFinestra.c: undefined reference toglHint@8'
    obj/RidimensionaFinestra.o(.text+0x31):RidimensionaFinestra.c: undefined reference to glViewport@16' obj/RidimensionaFinestra.o(.text+0x40):RidimensionaFinestra.c: undefined reference toglMatrixMode@4'
    obj/RidimensionaFinestra.o(.text+0x48):RidimensionaFinestra.c: undefined reference to glLoadIdentity@0' obj/RidimensionaFinestra.o(.text+0x66):RidimensionaFinestra.c: undefined reference togluOrtho2D@32'
    collect2: ld returned 1 exit status

    dllwrap.exe: no export definition file provided.
    Creating one, but that may not be what you want
    dllwrap.exe: gcc exited with status 1

    make.exe: *** [../../../Desktop/Analitica.dll] Error 1

    Execution terminated

     
    • SSanfilippo

      SSanfilippo - 2007-12-10

      The solution was much simpler than I expected... You have to specify -lopengl32 among the linker's parameters... This is auto-done by Dev-C++ only if you start the project as OpenGL sample.

       

Log in to post a comment.