Results 1 to 4 of 4

Thread: compiling errors when using opengl and debug

  1. #1
    Join Date
    Feb 2007
    Posts
    61
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default compiling errors when using opengl and debug

    Hi

    I am trying to get myself som debugging information from the application I am creating and in the project file I added:

    Qt Code:
    1. QT += opengl debug
    2. CONFIG += console
    To copy to clipboard, switch view to plain text mode 

    and then used qDebug() at the appropriate places within my code. However when I "make" the program I get the following error:

    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    oc -Wl,-s -Wl,-subsystem,console -mthreads -Wl -o release\gl.exe release/GLWidge
    t.o release/GLWindow.o release/main.o release/moc_GLWidget.o -L"c:\Qt\4.3.4\lib
    " -lopengl32 -lglu32 -lgdi32 -luser32 -lQtOpenGL4 -lQtGui4 -lQtCore4
    /mingw/lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `Win
    Main@16'
    collect2: ld returned 1 exit status
    mingw32-make[1]: *** [release\gl.exe] Error 1
    If I instead try to compile with "make debug" I get the following error:

    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    oc -Wl,-subsystem,console -mthreads -Wl -o debug\gl.exe debug/GLWidget.o debug/G
    LWindow.o debug/main.o debug/moc_GLWidget.o -L"c:\Qt\4.3.4\lib" -lopengl32 -lgl
    u32 -lgdi32 -luser32 -lQtOpenGLd4 -lQtGuid4 -lQtCored4
    C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot fin
    d -lQtOpenGLd4
    collect2: ld returned 1 exit status
    mingw32-make[1]: *** [debug\gl.exe] Error 1
    This is getting waaaay confusing for me. I have no idea what either of these means. All I am trying to do is to get some easy access to information from my app while I write it, but QT isn't making it easy for me unfortunately...

    Any help?
    Last edited by jpn; 30th March 2008 at 10:01. Reason: missing tags

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: compiling errors when using opengl and debug

    After adding "CONFIG += console" you have to force a rebuild (make clean or delete at least main.o). Do you have the debug version of Qt compiled? Notice the shortcut in Start-menu (provided that you used the installer).
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    invictus (30th March 2008)

  4. #3
    Join Date
    Feb 2007
    Posts
    61
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: compiling errors when using opengl and debug

    Quote Originally Posted by jpn View Post
    After adding "CONFIG += console" you have to force a rebuild (make clean or delete at least main.o). Do you have the debug version of Qt compiled? Notice the shortcut in Start-menu (provided that you used the installer).
    Apparently I did not have that. Do I need it?

    Seems like making clean worked excellent for release at least Thanks!

  5. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: compiling errors when using opengl and debug

    Quote Originally Posted by invictus View Post
    Apparently I did not have that. Do I need it?
    The open source version of Qt/Win does not come with debug libraries by default. One has to build them separately by following the link in Start-menu. And yes, you need them for compiling Qt projects in debug mode.
    J-P Nurmi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.