ich kann ein normales fenster mit nem normalen widget und nem normalen button kompilieren. aber wenn ich ein OpenGl projekt kompielieren will sagt mir das dos-promt:
glwidget.cpp:39:20: QtOpenGL: No such file or directory
...
glwidget.h:41:21: QGLWidget: No such file or directory
...
ich hab nachgeschaut, die headerdateien sind im include ordner des QT-Verzeichnises...
wie bekomm ich das hin?
aber wenn ich es reinschreibe und dann kompiliere funzt es auch nicht...
jedenfalls ist es jetzt ein anderer error also er findet die QtOpenGL.h
Tja, die QtOpenGL.h gibt es auch nicht...
Zitat:
btw: wie bringe ich QT dazu QT += opengl automatisch in die *.pro datei zu schreiben?
Da wirst du kein Glück haben. Ein qmake -project erstellt dir ein minimales .pro. Alles andere muss man immer selber erledigen.
Vllt. ist das mit ner IDE ala QtCreator/Eclpise+QtPlugin anders, wenn du sowas aber nicht nutzt musst du das händisch machen.
E:\Dev\Projekte-C++\QT\OpenGL>make
e:\Programme\Qt\4.4.3\bin\qmake.exe -win32 -o Makefile OpenGL.pro
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `E:/Dev/Projekte-C++/QT/OpenGL'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEED
S_QMAIN -I"..\..\..\..\Programme\Qt\4.4.3\include\QtCore" -I"..\..\..\..\Program
me\Qt\4.4.3\include\QtCore" -I"..\..\..\..\Programme\Qt\4.4.3\include\QtGui" -I"
..\..\..\..\Programme\Qt\4.4.3\include\QtGui" -I"..\..\..\..\Programme\Qt\4.4.3\
include\QtOpenGL" -I"..\..\..\..\Programme\Qt\4.4.3\include\QtOpenGL" -I"..\..\.
.\..\Programme\Qt\4.4.3\include" -I"." -I"e:\Programme\Qt\4.4.3\include\ActiveQt
" -I"debug" -I"." -I"..\..\..\..\Programme\Qt\4.4.3\mkspecs\default" -o debug\gl
widget.o glwidget.cpp
In file included from E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../.
./include/windows.h:50,
from ../../../../Programme/Qt/4.4.3/include/QtCore/../../src/co
relib/global/qt_windows.h:52,
from ../../../../Programme/Qt/4.4.3/include/QtCore/qt_windows.h
:1,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/../../src/
opengl/qgl.h:52,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/qgl.h:1,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/QtOpenGL:3
,
from glwidget.cpp:39:
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
63: error: declaration of C function `LONG InterlockedCompareExchange(volatile L
ONG*, LONG, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:387: error: previous declaration `long int InterlockedCompareExchange(lon
g int*, long int, long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
67: error: declaration of C function `LONG InterlockedDecrement(volatile LONG*)'
conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:389: error: previous declaration `long int InterlockedDecrement(long int*
)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
68: error: declaration of C function `LONG InterlockedExchange(volatile LONG*, L
ONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:390: error: previous declaration `long int InterlockedExchange(long int*,
long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
72: error: declaration of C function `LONG InterlockedExchangeAdd(volatile LONG*
, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:391: error: previous declaration `long int InterlockedExchangeAdd(long in
t*, long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
76: error: declaration of C function `LONG InterlockedIncrement(volatile LONG*)'
conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:388: error: previous declaration `long int InterlockedIncrement(long int*
)' here
mingw32-make[1]: *** [debug/glwidget.o] Error 1
mingw32-make[1]: Leaving directory `E:/Dev/Projekte-C++/QT/OpenGL'
mingw32-make: *** [debug] Error 2
E:\Dev\Projekte-C++\QT\OpenGL>make
e:\Programme\Qt\4.4.3\bin\qmake.exe -win32 -o Makefile OpenGL.pro
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `E:/Dev/Projekte-C++/QT/OpenGL'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEED
S_QMAIN -I"..\..\..\..\Programme\Qt\4.4.3\include\QtCore" -I"..\..\..\..\Program
me\Qt\4.4.3\include\QtCore" -I"..\..\..\..\Programme\Qt\4.4.3\include\QtGui" -I"
..\..\..\..\Programme\Qt\4.4.3\include\QtGui" -I"..\..\..\..\Programme\Qt\4.4.3\
include\QtOpenGL" -I"..\..\..\..\Programme\Qt\4.4.3\include\QtOpenGL" -I"..\..\.
.\..\Programme\Qt\4.4.3\include" -I"." -I"e:\Programme\Qt\4.4.3\include\ActiveQt
" -I"debug" -I"." -I"..\..\..\..\Programme\Qt\4.4.3\mkspecs\default" -o debug\gl
widget.o glwidget.cpp
In file included from E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../.
./include/windows.h:50,
from ../../../../Programme/Qt/4.4.3/include/QtCore/../../src/co
relib/global/qt_windows.h:52,
from ../../../../Programme/Qt/4.4.3/include/QtCore/qt_windows.h
:1,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/../../src/
opengl/qgl.h:52,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/qgl.h:1,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/QtOpenGL:3
,
from glwidget.cpp:39:
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
63: error: declaration of C function `LONG InterlockedCompareExchange(volatile L
ONG*, LONG, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:387: error: previous declaration `long int InterlockedCompareExchange(lon
g int*, long int, long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
67: error: declaration of C function `LONG InterlockedDecrement(volatile LONG*)'
conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:389: error: previous declaration `long int InterlockedDecrement(long int*
)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
68: error: declaration of C function `LONG InterlockedExchange(volatile LONG*, L
ONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:390: error: previous declaration `long int InterlockedExchange(long int*,
long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
72: error: declaration of C function `LONG InterlockedExchangeAdd(volatile LONG*
, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:391: error: previous declaration `long int InterlockedExchangeAdd(long in
t*, long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
76: error: declaration of C function `LONG InterlockedIncrement(volatile LONG*)'
conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:388: error: previous declaration `long int InterlockedIncrement(long int*
)' here
mingw32-make[1]: *** [debug/glwidget.o] Error 1
mingw32-make[1]: Leaving directory `E:/Dev/Projekte-C++/QT/OpenGL'
mingw32-make: *** [debug] Error 2
E:\Dev\Projekte-C++\QT\OpenGL>make
e:\Programme\Qt\4.4.3\bin\qmake.exe -win32 -o Makefile OpenGL.pro
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `E:/Dev/Projekte-C++/QT/OpenGL'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEED
S_QMAIN -I"..\..\..\..\Programme\Qt\4.4.3\include\QtCore" -I"..\..\..\..\Program
me\Qt\4.4.3\include\QtCore" -I"..\..\..\..\Programme\Qt\4.4.3\include\QtGui" -I"
..\..\..\..\Programme\Qt\4.4.3\include\QtGui" -I"..\..\..\..\Programme\Qt\4.4.3\
include\QtOpenGL" -I"..\..\..\..\Programme\Qt\4.4.3\include\QtOpenGL" -I"..\..\.
.\..\Programme\Qt\4.4.3\include" -I"." -I"e:\Programme\Qt\4.4.3\include\ActiveQt
" -I"debug" -I"." -I"..\..\..\..\Programme\Qt\4.4.3\mkspecs\default" -o debug\gl
widget.o glwidget.cpp
In file included from E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../.
./include/windows.h:50,
from ../../../../Programme/Qt/4.4.3/include/QtCore/../../src/co
relib/global/qt_windows.h:52,
from ../../../../Programme/Qt/4.4.3/include/QtCore/qt_windows.h
:1,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/../../src/
opengl/qgl.h:52,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/qgl.h:1,
from ../../../../Programme/Qt/4.4.3/include/QtOpenGL/QtOpenGL:3
,
from glwidget.cpp:39:
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
63: error: declaration of C function `LONG InterlockedCompareExchange(volatile L
ONG*, LONG, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:387: error: previous declaration `long int InterlockedCompareExchange(lon
g int*, long int, long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
67: error: declaration of C function `LONG InterlockedDecrement(volatile LONG*)'
conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:389: error: previous declaration `long int InterlockedDecrement(long int*
)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
68: error: declaration of C function `LONG InterlockedExchange(volatile LONG*, L
ONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:390: error: previous declaration `long int InterlockedExchange(long int*,
long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
72: error: declaration of C function `LONG InterlockedExchangeAdd(volatile LONG*
, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:391: error: previous declaration `long int InterlockedExchangeAdd(long in
t*, long int)' here
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
76: error: declaration of C function `LONG InterlockedIncrement(volatile LONG*)'
conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:388: error: previous declaration `long int InterlockedIncrement(long int*
)' here
mingw32-make[1]: *** [debug/glwidget.o] Error 1
mingw32-make[1]: Leaving directory `E:/Dev/Projekte-C++/QT/OpenGL'
mingw32-make: *** [debug] Error 2
da ich 'normale' Qt-Apps problemlos unter Dev-C++ kompilieren kann, habe ich versucht ein Qt-OpenGl-App zu kompilieren - funzt aber auch da nicht...
btw: wenn jemand das gleiche problem hatte wie ich, dass er bei jedem neuem QT-Projekt unter Dev-C++ in den projekt options die include-dirs und die library-dirs ändern musste um das projekt zu kompilieren, für den gibt es 2 lösungen:
1.)
-die librarys (alle *.a-dateien) in das verzeichnis '\Dev-Cpp\lib' kopieren.
-die includes (alle ordner die im verzeichnis '\QT\4.4.x\include' liegen) in das verzeichnis '\Dev-Cpp\include' kopieren.
-oder-
2.)
in der datei 'QT4 Application.template' alle verzeichnisse bei 'Include' und 'Linker' ändern.
bei mir sieht das folgendermaßen aus:
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
63: error: declaration of C function `LONG InterlockedCompareExchange(volatile L
ONG*, LONG, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:387: error: previous declaration `long int InterlockedCompareExchange(lon
g int*, long int, long int)' here
Code:
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
63: error: declaration of C function `LONG InterlockedCompareExchange(volatile L
ONG*, LONG, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:387: error: previous declaration `long int InterlockedCompareExchange(lon
g int*, long int, long int)' here
Code:
E:/Programme/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/winbase.h:16
63: error: declaration of C function `LONG InterlockedCompareExchange(volatile L
ONG*, LONG, LONG)' conflicts with
../../../../Programme/Qt/4.4.3/include/QtCore/../../src/corelib/arch/qatomic_win
dows.h:387: error: previous declaration `long int InterlockedCompareExchange(lon
g int*, long int, long int)' here
In qatomic_windows.h Zeile 387 und winbase.h Zeile 16 wird InterlockedCompareExchange deklariert.
K.A. was da los ist. Falsches mkspec? Hast du einen Header bearbeitet? Qt4 selber kompiliert?
Was ich so gelesen hab ist ja dev-cpp recht veraltet (fehlerbehaftet?). Schau dir einfach mal Eclipse, Code::Blocks oder den neuen QtCreator an. Vllt. hast du da solche Probleme nicht mehr.
Aber wirklich helfen kann ich dir da jetzt leider nicht. Hab keinen Windows-Rechner in der Nähe...
Nächstes Thema anzeigen Vorheriges Thema anzeigen
Sie können keine Beiträge in dieses Forum schreiben. Sie können auf Beiträge in diesem Forum antworten. Sie können Ihre Beiträge in diesem Forum nicht bearbeiten. Sie können Ihre Beiträge in diesem Forum nicht löschen. Sie können an Umfragen in diesem Forum nicht mitmachen.
c++.de ist Teilnehmer des Partnerprogramms von Amazon Europe S.à.r.l. und Partner des Werbeprogramms, das zur Bereitstellung eines Mediums
für Websites konzipiert wurde, mittels dessen durch die Platzierung von Werbeanzeigen und Links zu amazon.de
Werbekostenerstattung verdient werden kann.
Die Vervielfältigung der auf den Seiten www.c-plusplus.de, www.c-plusplus.info, www.c-sar.de, www.c-plusplus.net und www.baeckmann.de
enthaltenen Informationen ohne eine schriftliche Genehmigung des Seitenbetreibers ist untersagt
(vgl. §4 Urheberrechtsgesetz). Die Nutzung und Änderung der vorgestellten Strukturen und Verfahren in
privaten und kommerziellen Softwareanwendungen ist ausdrücklich erlaubt, soweit keine Rechte Dritter verletzt werden.
Der Seitenbetreiber übernimmt keine Gewähr für die Funktion einzelner Beiträge oder Programmfragmente, insbesondere
übernimmt er keine Haftung für eventuelle aus dem Gebrauch entstehenden Folgeschäden.