I think better you install it from Synaptic.
I think better you install it from Synaptic.
I added Qt to my system's path using this command:
then qmake worked smoothly.
But got one more issue, the make command yield this error:
I guess that g++ can't locate Qt Libraries.. !Qt Code:
To copy to clipboard, switch view to plain text mode
well I found that thread in Ubuntu forums:
http://ubuntuforums.org/archive/index.php/t-231764.html
So, is it really that g++ can't locate my Qt Libraries? If so, how to solve it?by asimon
:
....
You need to tell g++ where to find the include files. I.e. something like
$ g++ -I/usr/include/qt4/include foo.cpp
But this is not enough. You also need to tell it what libraries to link against, i.e. something like
$ g++ -I/usr/include/qt4/include -L/usr/lib/include/qt4/lib -lQtGui -lQtCore -lpthread foo.cpp
You should better use some automation here, like for example Qt's qmake. I.e. put your foo.cpp program in a directory called 'foo' and run 'qmake -project'. That will scann the current directory for source files and create a foo.pro project file. Then call 'qmake' which generates a Makefile from the .pro file. Then a simple 'make' will build you program 'foo' and if everything works as expected it should take care of all the needed compiler options.
:
...
Or just I didn't add path correctly? If so, how to do it right ?
---------------------
@HelderC:
Sure it's far better, but installing more than 300 mega bytes with a slow and unstable connection is a big issue for me.I think better you install it from Synaptic.
that because I've a slow Internet connection on th Linux machine, so I can't use internet to download it.
Thanks all for replaying.
Last edited by ibn-tashfin; 11th January 2011 at 19:08. Reason: spelling corrections
Project file:
helloWorld.pro
Qt Code:
TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += . # Input SOURCES += helloWorld.cppTo copy to clipboard, switch view to plain text mode
It's installed in the opt directory.
What does qmake -query return for QT_INSTALL_HEADERS? Better yet show us the whole output.
ibn-tashfin (11th January 2011)
Here what you asked:What does qmake -query return for QT_INSTALL_HEADERS? Better yet show us the whole output.
qmake -query output Code:
QT_INSTALL_PREFIX:/usr QT_INSTALL_DATA:/usr/share/qt4 QT_INSTALL_DOCS:/usr/share/qt4/doc QT_INSTALL_HEADERS:/usr/include/qt4 QT_INSTALL_LIBS:/usr/lib QT_INSTALL_BINS:/usr/bin QT_INSTALL_PLUGINS:/usr/lib/qt4/plugins QT_INSTALL_IMPORTS:/usr/lib/qt4/imports QT_INSTALL_TRANSLATIONS:/usr/share/qt4/translations QT_INSTALL_CONFIGURATION:/etc/xdg QT_INSTALL_EXAMPLES:/usr/lib/qt4/examples QT_INSTALL_DEMOS:/usr/lib/qt4/demos QMAKE_MKSPECS:/usr/share/qt4/mkspecs QMAKE_VERSION:2.01a QT_VERSION:4.7.0To copy to clipboard, switch view to plain text mode
and thanks for help, I appreciate your effort with me
[+]:
I found that I have installed qmake package separately from Qt SDK, I think that makes problems.
so I uninstalled Qt now, and uninstalled qmake too.
do I have to remove the /usr qt's directories?
I'll begin installing it again, but after your suggestions about where to install it.
Last edited by ibn-tashfin; 11th January 2011 at 21:40. Reason: updated contents
I'm so exited so I couldn't waitI'll begin installing it again, but after your suggestions about where to install it.
anyways I installed it in the home directory. and added Qt's bin directory to the system paths, the same way before.
and guess what, it works perfectly
so the problem was from installing qmake separately, so that the system reads the second install of qmake which knows nothing about my Qt SDK installation.
Well, I'm happy now, back to the world of Qt again
Thanks for the help wysota.
This seems like qmake from your Ubuntu Qt installation and not the one you installed in /opt. How exactly did you modify your PATH?
Edit: yeah... well.. too late Anyway, glad you made it work.
yeah I'm glad too.
Thanks again.
Bookmarks