Difference between QT3 and QT4 when both are present
How would a compiler get to know whether the project that I am compiling is to be compiled with QT3 or QT4?
Please explain as I have to install QT4 and I don't want to do that till I am sure this is not going to ruin my system and the program that I have made. |
Quote:
If I am correct, you have to learn how to specify include directories for compiler and library search path for linker. |
So, If i could only remove and add the path in my .profile would that work??
|
You will probably have to use qmake to compile your program, due to the meta objects. qt4 .pro files are not compatible with the qt3 version of qmake.
On my system (Debian): $ qmake <tab><tab> qmake qmake-qt3 qmake-qt4 $ type qmake qmake is /usr/bin/qmake $ ls -l /usr/bin/qmake lrwxrwxrwx 1 root root 23 2006-03-10 20:57 /usr/bin/qmake -> /etc/alternatives/qmake $ ls -l /etc/alternatives/qmake lrwxrwxrwx 1 root root 18 2008-12-27 01:22 /etc/alternatives/qmake -> /usr/bin/qmake-qt4 So you either need to make sure the symlink(s) point to the correct qmake, or remember to type qmake-qt4 each time. Otherwise you'll get a bunch of errors. On your distribution, if qt3 and qt4 packages aren't compatible, the maintainer has probably configured them to conflict with each other. If you don't have the qt3 development stuff installed, it's probably a non-issue. HTH map250r |
Quote:
You'll be using different qmake version for qt3 and qt4 projects. Generated Qt3 and Qt4 binaries will use different libraries. Quote:
Quote:
Qt projects are created from *.pro file. In order to generate makefile, *.pro file is fed to qmake. Qmake defines which set of libraries is used. Use qmake from Qt 4, and makefile will link your program with Qt 4 libraries, use it With Qt 3 - and you'll get Qt 3 libraries. In reality, of course, Qt 4 make probably won't "understand" Qt 3 *.pro file (makefile generation will fail) and vice versa. |
Most Linux have both Qt3 and Qt4 these days.
You get /usr/lib/qt3/ and /usr/lib/qt4 . And /usr/bin/qmake , /usr/bin/qmake-qt4 . If required, please install Qt4 with your package manager. "Projects" usually end up with a 'Makefile', selecting the right qt. .... EDIT : sorry, too simplistic, see # 4 - # 5 .... |
Quote:
|
Thank you guyz for such good help.
Finally, I had made a code with QT3 in mind. So can i safely install QT4 and start running in the code without much hassle. Actually I wanted to use cross thread signal slot systems which i learnt was not supported in QT3 (after reaching a level where my project was to end in next 2 days). So I am apprehensive that working with QT4 will create havoc coz I read some posts of people complaining a lot of changes. If also there is a way by which we can use cross thread signal slot without changing to QT4 (its the last phase of my project...). Help would be appreciated. And if there is really no problem with running a code written for QT3 in QT4 then i could change it ... would be good with me... Thank you so much guyz |
Quote:
You create *.pro file, THEN generate makefile from it, and THEN compile project using that makefile. You can get away with normal makefiles ONLY if you aren't creating your own objects with signals and slots, because header of any Q_OBJECT class must be processed with moc to become compileable/useful. |
All times are GMT -5. The time now is 02:43 PM. |