Hello,
I'm trying to compile this simple program at command line:
I typed:Qt Code:
#include <QApplication> #include <QWidget> int main(int argc, char* argv[]) { QWidget w; w.resize(640, 480); w.show(); return app.exec(); }To copy to clipboard, switch view to plain text mode
'make' gives me a lot of errors. I suppose they depend from 'bad setting' of qt or other things under LInux.qmake -project //ok
qmake //ok
make //errors
Just to give an idea of the problem:
Does anybody have an idea about the problem?gcc -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o main.o main.c
In file included from /usr/include/QtCore/qobjectdefs.h:45:0,
from /usr/include/QtCore/qobject.h:47,
from /usr/include/QtCore/qcoreapplication.h:45,
from /usr/include/QtGui/qapplication.h:45,
from /usr/include/QtGui/QApplication:1,
from main.c:1:
/usr/include/QtCore/qnamespace.h: In function ‘QT_MODULE’:
/usr/include/QtCore/qnamespace.h:54:1: error: unknown type name ‘namespace’
namespace
^
/usr/include/QtCore/qnamespace.h:58:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or __attribute__’ before ‘{’ token
Qt {
^
/usr/include/QtCore/qnamespace.h:1799:1: error: expected declaration specifiers before ‘Q_DECLARE_OPERATORS_FOR_FLAGS’
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MouseButtons)
^
/usr/include/QtCore/qnamespace.h:1820:1: error: unknown type name ‘class’
class Q_CORE_EXPORT QInternal {
^
/usr/include/QtCore/qnamespace.h:1820:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QInternal’
class Q_CORE_EXPORT QInternal {
^
/usr/include/QtCore/qnamespace.h:1875:2: error: expected declaration specifiers before ‘;’ token
};
^
In file included from /usr/include/QtCore/qobject.h:47:0,
from /usr/include/QtCore/qcoreapplication.h:45,
from /usr/include/QtGui/qapplication.h:45,
from /usr/include/QtGui/QApplication:1,
from main.c:1:
[.................................................. .................................................. ................so on.......]
Hello,
I'm trying to compile this simple program at command line:
I typed:Qt Code:
#include <QApplication> #include <QWidget> int main(int argc, char* argv[]) { QWidget w; w.resize(640, 480); w.show(); return app.exec(); }To copy to clipboard, switch view to plain text mode
'make' gives me a lot of errors. I suppose they depend from 'bad setting' of qt or other things under LInux.qmake -project //ok
qmake //ok
make //errors
Just to give an idea of the problem:
Does anybody have an idea about the problem?gcc -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -o main.o main.c
In file included from /usr/include/QtCore/qobjectdefs.h:45:0,
from /usr/include/QtCore/qobject.h:47,
from /usr/include/QtCore/qcoreapplication.h:45,
from /usr/include/QtGui/qapplication.h:45,
from /usr/include/QtGui/QApplication:1,
from main.c:1:
/usr/include/QtCore/qnamespace.h: In function ‘QT_MODULE’:
/usr/include/QtCore/qnamespace.h:54:1: error: unknown type name ‘namespace’
namespace
^
/usr/include/QtCore/qnamespace.h:58:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or __attribute__’ before ‘{’ token
Qt {
^
/usr/include/QtCore/qnamespace.h:1799:1: error: expected declaration specifiers before ‘Q_DECLARE_OPERATORS_FOR_FLAGS’
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MouseButtons)
^
/usr/include/QtCore/qnamespace.h:1820:1: error: unknown type name ‘class’
class Q_CORE_EXPORT QInternal {
^
/usr/include/QtCore/qnamespace.h:1820:21: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QInternal’
class Q_CORE_EXPORT QInternal {
^
/usr/include/QtCore/qnamespace.h:1875:2: error: expected declaration specifiers before ‘;’ token
};
^
In file included from /usr/include/QtCore/qobject.h:47:0,
from /usr/include/QtCore/qcoreapplication.h:45,
from /usr/include/QtGui/qapplication.h:45,
from /usr/include/QtGui/QApplication:1,
from main.c:1:
[.................................................. .................................................. ................so on.......]
Added after 1 34 minutes:
Hello again,
I found out to have installed also qmake-qt5. So using it I got a just an error:
What do you think? Anything is improving?Qt Code:
make gcc -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o main.o main.c #include <QApplication> ^ compilation terminated. make: *** [main.o] Error 1To copy to clipboard, switch view to plain text mode
Bookmarks