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ę...