Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Problem with gqBegin/glEnd and others
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...
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.
utcenter last edited by
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.
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.
utcenter last edited by
[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
- Download all files needed to install
- qt Creator - http://qt-project.org/downloads
- qt Libraries - ftp://ftp.qt-project.org/qt/source/ I choosed versiom qt-win-opensource-4.7.4-mingw
- download MinGW in version from http://nosymbolfound.blogspot.com/2012/12/since-until-now-qt-under-windows-is.html
- create folder MinGW in C:/ directory.
- unzip MinGW downloaded from the Internet a@@nd copy all files to C:/MinGW
- install QtCreator
- install qtLibraries
- Preparing to using QtCreator with our qtLirbaries
- open Qt Creator
- from Tools menu chose Options, and add options like on the screens under:
I do hope that could help somebody.