ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
To get a makefile, i use this command: qmake -o Makefile QT.pro
When I type in make, this message appears:
Code:
g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/lib/qt/mkspecs/default -I. -I. -I/usr/lib/qt/include -o hello_world.o hello_world.cpp
hello_world.cpp:1:24: error: QApplication: No such file or directory
hello_world.cpp:2:18: error: QLabel: No such file or directory
hello_world.cpp: In function 'int main()':
hello_world.cpp:6: error: 'QApplication' was not declared in this scope
hello_world.cpp:6: error: expected `;' before 'a'
hello_world.cpp:8: error: 'QLabel' was not declared in this scope
hello_world.cpp:8: error: expected `;' before 'label'
hello_world.cpp:9: error: 'label' was not declared in this scope
hello_world.cpp:11: error: 'a' was not declared in this scope
make: *** [hello_world.o] Error 1
I don't know what the problem is. How can I compile and run the programs created in QT in a efficient way?
hello_world.cpp:1:24: error: QApplication: No such file or directory
hello_world.cpp:2:18: error: QLabel: No such file or directory
hello_world.cpp: In function 'int main()':
hello_world.cpp:6: error: 'QApplication' was not declared in this scope
hello_world.cpp:6: error: expected `;' before 'a'
hello_world.cpp:8: error: 'QLabel' was not declared in this scope
hello_world.cpp:8: error: expected `;' before 'label'
hello_world.cpp:9: error: 'label' was not declared in this scope
hello_world.cpp:11: error: 'a' was not declared in this scope
This indicates there could be a problem with your source. Can you post? Make sure to use code tags.
This compile works fine on my system. If your include paths and lib paths are still wrong you can set them with the following in your project file.
Code:
INCLUDEPATH += <dir>
LIBRARYPATH += <dir>
Hi!
It doesen't work. I still get the message:
Code:
hello_world.cpp:1:24: error: QApplication: No such file or directory
hello_world.cpp:2:18: error: QLabel: No such file or directory
hello_world.cpp: In function 'int main(int, char**)':
hello_world.cpp:6: error: 'QApplication' was not declared in this scope
hello_world.cpp:6: error: expected `;' before 'a'
hello_world.cpp:8: error: 'QLabel' was not declared in this scope
hello_world.cpp:8: error: expected `;' before 'label'
hello_world.cpp:9: error: 'label' was not declared in this scope
hello_world.cpp:11: error: 'a' was not declared in this scope
hello_world.cpp: At global scope:
hello_world.cpp:4: warning: unused parameter 'argc'
hello_world.cpp:4: warning: unused parameter 'argv'
How can I compile a application SIMPLE in QT? When I used Ubuntu, I compiled my application, by going to the menu. But that option doesen't exists QT on Slackware system. Why?
I don't think that you are picking up the qt4 library, rather I suspect that you are picking up the code in the qt3 library. You may need to add this path to your $PATH variable.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.