Simon.tux
18th July 2007, 19:44
Hello to all , I'm new in Qt . I have a small problem , today I have made the update to Qt 4.3.0 on my Linux box .
if I try to compile
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
Then I made .pro file using qmake -project and finally I made make file using qmake . Then it gave the following error :
g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o hello.o hello.cpp
hello.cpp:24:25: error: QApplication: Nessun file o directory
hello.cpp:25:24: error: QPushButton: Nessun file o directory
hello.cpp:36:3: warning: no newline at end of file
hello.cpp: In function ‘int main(int, char**)’:
hello.cpp:29: error: ‘QApplication’ was not declared in this scope
hello.cpp:29: error: expected `;' before ‘app’
hello.cpp:31: error: ‘QPushButton’ was not declared in this scope
hello.cpp:31: error: expected `;' before ‘hello’
hello.cpp:32: error: ‘hello’ was not declared in this scope
hello.cpp:35: error: ‘app’ was not declared in this scope
hello.cpp: At global scope:
hello.cpp:27: warning: unused parameter ‘argc’
hello.cpp:27: warning: unused parameter ‘argv’
make: *** [hello.o] Error 1
I believe that I am an error of the path , you can help me to resolve and set the path on linux machine step to step.
sorry for my bad English ....
if I try to compile
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
Then I made .pro file using qmake -project and finally I made make file using qmake . Then it gave the following error :
g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o hello.o hello.cpp
hello.cpp:24:25: error: QApplication: Nessun file o directory
hello.cpp:25:24: error: QPushButton: Nessun file o directory
hello.cpp:36:3: warning: no newline at end of file
hello.cpp: In function ‘int main(int, char**)’:
hello.cpp:29: error: ‘QApplication’ was not declared in this scope
hello.cpp:29: error: expected `;' before ‘app’
hello.cpp:31: error: ‘QPushButton’ was not declared in this scope
hello.cpp:31: error: expected `;' before ‘hello’
hello.cpp:32: error: ‘hello’ was not declared in this scope
hello.cpp:35: error: ‘app’ was not declared in this scope
hello.cpp: At global scope:
hello.cpp:27: warning: unused parameter ‘argc’
hello.cpp:27: warning: unused parameter ‘argv’
make: *** [hello.o] Error 1
I believe that I am an error of the path , you can help me to resolve and set the path on linux machine step to step.
sorry for my bad English ....