What does this error mean?
-
Please be more specific.
I skimmed your post and do not see an error, only warnings (there is a difference.) I don't think most readers want to read 40 lines. Instead, please tell us exactly what error message you are concerned about.
-
You are using the QString::arg() function which does not modify the original string but returns a new modified string. You are not using the return value, hence your code is essentially a no-op.
-
Hello, Thanks for replying. My previous message was the output I got when trying to compile an example of Qt. I got a very long warning/error message and the program did not work.
I tried a simpler code:
@
#include <QApplication>
#include <QPushButton>int main(int argc, char *argv[])
{
QApplication app(argc, argv);QPushButton bouton("Hello World!"); bouton.show(); return app.exec();
}
@It does not work and the error message is:
@
../test/main.cpp:1:24: error: QApplication: No such file or directory
../test/main.cpp:2:23: error: QPushButton: No such file or directory
../test/main.cpp: In function 'int main(int, char**)':
../test/main.cpp:6: error: 'QApplication' was not declared in this scope
../test/main.cpp:6: error: expected;' before 'app' ../test/main.cpp:8: error: 'QPushButton' was not declared in this scope ../test/main.cpp:8: error: expected
;' before 'bouton'
../test/main.cpp:9: error: 'bouton' was not declared in this scope
../test/main.cpp:11: error: 'app' was not declared in this scope
../test/main.cpp: At global scope:
../test/main.cpp:4: warning: unused parameter 'argc'
../test/main.cpp:4: warning: unused parameter 'argv'
make: *** [main.o] Error 1
@
Any hints? Thanks a lot :)[Edit: Added @ tags for formatting -- mlong]
-
Hi,
since you'r using Qt5 add QT += qtwidgets to you pro file
-
Hi,
Looks like all Qt objects are missing (compiler does not see includes files). Can you post .pro file?
BR,
-
Hello, this is all what was written automatically in the .pro file:
SOURCES +=
main.cpp -
@SGaist: I added QT += qtwidgets and here is the error message:
Project ERROR: Unknown module(s) in QT: qtwidgets
make: *** [Makefile] Error 3
make: Leaving directory `/Users/ines/test-build-Desktop_Qt_5_0_1_clang_64bit-Debug'
10:13:10: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project test (kit: Desktop Qt 5.0.1 clang 64bit)
When executing step 'Make' -
Your pro file does not contain the minimal stuff to build a Qt project. Since your trying things, delete that project and create a new Qt Gui Application with QtCreator. This will give you a starting point to test code
-
I created a Qt Gui Application but again I have this huge list of warnings as output and then this
10:45:48: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project test (kit: Desktop Qt 5.0.1 clang 64bit)
When executing step 'Make' -
A question, When I compile an example of Qt creator, it should normally work? I tried out different example and each time I have this huge list of warning and errors ...