Problem with gqBegin/glEnd and others



  • Hello,
    This is my first post so welcome everyone!!
    I have problem with new Qt 5.0.1
    After installation QT 5.0.1 with Qt Creator in one package I cannot compile simple drawing application. I think that is problem that i have x64 processor and OS but this installation packed is only for 32 (http://qt-project.org/downloads) I downloaded Qt 5.0.1 for Windows 32-bit (MinGW 4.7, 823 MB) version.

    I need help as soon as possible, because this is project for my studies, and the end date is on next week.

    I think the problem is with version. Maybe somebody know where I can download older QTCreator with QT liblary in one package.
    When I try to do this i get message that:

    @...\Documents\OpenGL\OiWSR\glwidget.cpp:24: błąd:undefined reference to _imp__glBegin@4' ...\Documents\OpenGL\OiWSR\glwidget.cpp:25: błąd:undefined reference to_imp__glVertex3f@12'
    ...\Documents\OpenGL\OiWSR\glwidget.cpp:26: błąd:undefined reference to _imp__glVertex3f@12' ...\Documents\OpenGL\OiWSR\glwidget.cpp:27: błąd:undefined reference to_imp__glEnd@0'
    collect2.exe:-1: błąd:error: ld returned 1 exit status@

    Thanks a lot for any help...


  • Moderators

    It has nothing to do with your processor or the version. Prepackaged Qt uses ANGLE on Windows, which has only the OpenGL ES instruction set. This means no fixed pipeline (glBegin, glVertex etc.).

    Use ES pipeline, which means vertex buffers and shaders (close to the Core profile in OpenGL 3.0), or download Qt source package and compile it yourself with the "-opengl desktop" switch to get the full OpenGL version support.



  • Building Qt with desktop OpenGL support has many beneficial sides to it, but allowing bad programming practice and learning already deprecated features is hardly one of it.

    People seem to be stuck using glBegin and glEnd because of the number of outdated tutorials around the web.



  • I understand that this is old practice using glBegin... but this is requirement for this project.


  • Moderators

    Yeah, that's a real problem these days. Schools and online tutorials teach OpenGL 2 or even 1.x. Libraries (like GLEW) don't properly support core profile. Default windows drivers support archaic OpenGL version...

    As much as what utcenter said is true your best bet is to misuse the -opengl desktop switch, or if you don't need Qt goodies that much - use basic toolkit like freeglut and vanilla OpenGL without (gulp...) Qt.



  • [quote author="Spilka" date="1361707276"]I understand that this is old practice using glBegin... but this is requirement for this project.[/quote]

    It is surely an unusual practice to make sub-efficiency and bad practice a requirement. But hey, it is not like I wasn't told to make stupid stuff back in my job.



  • OK. The problem has been resolved.
    Maybe it could help for someone on future. So I send steps how to bypass this problem

    1. Download all files needed to install
    1. Installation
    • create folder MinGW in C:/ directory.
    • unzip MinGW downloaded from the Internet a@@nd copy all files to C:/MinGW
    • install QtCreator
    • install qtLibraries
    1. Preparing to using QtCreator with our qtLirbaries
    • open Qt Creator
    • from Tools menu chose Options, and add options like on the screens under:

    bq. https://docs.google.com/file/d/0B8htU5kOTumVSDUySGNwYnl0cjQ/edit?usp=sharing
    https://docs.google.com/file/d/0B8htU5kOTumVZ3VwRzUybUpBMHM/edit?usp=sharing
    https://docs.google.com/file/d/0B8htU5kOTumVYmc4WHJzMGNrdW8/edit?usp=sharing

    I do hope that could help somebody.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.