Qt 5.0 i openGL

0

Witam

Przy tworzeniu nowego projektu i dodaniu jakiegoś nagłówka z GL/... np. GL/gl.h dostaję szereg błędów.

C:\Qt Projects\MyGL\mainwindow.h:6: In file included from ..\MyGL\mainwindow.h:6:0,
C:\Qt Projects\MyGL\main.cpp:1: from ..\MyGL\main.cpp:1:
d:\qt\qt5.0.2\tools\mingw\i686-w64-mingw32\include\GL\gl.h:34: błąd:conflicting declaration 'typedef double GLdouble'
D:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtOpenGL\qgl.h:47: In file included from D:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtOpenGL/qgl.h:47:0,
D:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtOpenGL\QGLWidget:1: from D:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtOpenGL/QGLWidget:1,
C:\Qt Projects\MyGL\mainwindow.h:5: from ..\MyGL\mainwindow.h:5,
C:\Qt Projects\MyGL\main.cpp:1: from ..\MyGL\main.cpp:1:
D:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtGui\qopengl.h:71: błąd:'GLdouble' has a previous declaration as 'typedef GLfloat GLdouble'

plik .pro

QT       += core gui opengl

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = MyGL
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

LIBS += -lGLU

plik .h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QGLWidget>
#include <GL/gl.h>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    
private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H

main i mainwindow.cpp nie ruszane w ogólę...

0

Spróbuj wywalić #include <GL/gl.h>

Zdaje się, że Qt wprowadza swoją wersję tego nagłówka i nie musisz dołączać normalnego nagłówka OpenGL.

BTW. Twoja ksywka to z tego nowego serialu, Vikings ;) ?

1

kompiluje się ale wtedy nawet te metody się nie nadpisują...

void initializeGL();
void paintGL();

Miałem wcześniejszy projekt i wszystko chodziło dobrze (teraz format i nowy system i QT 5.0 zamiast 4.8) i nic z OpenGL nie mogę ruszyć przez te błędy...

PS. tak :)

0

Problem jest znany i jest na to zgłoszony bug.

0

Kai Köhne added a comment - 20/Mar/13 8:29 AM
Maybe we can add at one point add a Mingw-64bit-opengl too. But we certainly can't cater for all the different combinations of toolchains and Qt configurations that are possible. Anyhow,** it's not that hard to build Qt by yourself **...

Może dla nich, dla biednych studentów i ludzi którzy dopiero poznają niektóre rzeczy jest :)

1 użytkowników online, w tym zalogowanych: 0, gości: 1