Results 1 to 7 of 7

Thread: QtCreator can't find Qt + failed uninstall of earlier version

  1. #1
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QtCreator can't find Qt + failed uninstall of earlier version

    I've gone through a number of versions of Qt and have only had this problem with 4.7+. When I try to compile previously working programs in QtCreator, I get 'QtGui/QApplication: No such file or directory' errors for all the Qt library files I'm using. I do not get these errors for programs installed within the Qt directory itself--e.g. the demos compile and run just fine--but naturally most of my programs aren't installed there.

    Obviously, this is a path issue, but I haven't been able to resolve it by changing System Environment variable values. My PATH variable contains

    /usr/local/Trolltech/Qt-4.7.1/bin
    along with the default path items; adding the directory to which I installed Qt,

    ~/qt-everywhere-opensource-src-4.7.1 (/include or /bin)
    doesn't help things. Modifying INCLUDEPATH in the .pro file doesn't help either.

    Probably not related, but in addition QtCreator is still 'finding' Qt 4.6.2 even though I have installed it and deleted its files from /usr/lib. Anybody know how to get rid of this (as well as how to solve the main problem)?

  2. #2
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QtCreator can't find Qt + failed uninstall of earlier version

    Update: So I got the default QtGui application to work, but here's what it took (added to the .pro file):

    LIBS += -L/home/matt/qt-everywhere-opensource-src-4.7.1/lib -lQtGui \
    -L/usr/local/Trolltech/Qt-4.7.1/lib -lQtGui
    INCLUDEPATH += /home/matt/qt-everywhere-opensource-src-4.7.1/include \
    /home/matt/qt-everywhere-opensource-src-4.7.1/include/QtGui
    However isn't sufficient for larger programs, they need many more libraries besides QtGui; and this would have to be created anew for each platform. So surely this isn't the right way out of the problem, nor is building all my programs within the Qt directory... so what can I do?

  3. #3
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QtCreator can't find Qt + failed uninstall of earlier version

    Another update: I went into the Makefile (for the default QtGui application I created, "asdf") and found

    INCPATH = -I/usr/local/Trolltech/Qt-4.7.1/mkspecs/linux-g++-64 -I../asdf -I/home/matt/include/QtCore -I/home/matt/include/QtGui -I/home/matt/include -I.moc/release-shared -I.uic/release-shared -I.
    LIBS = $(SUBLIBS) -L/home/matt/lib -lQtGui -lQtCore -lpthread
    What's weird is that neither of /home/matt/lib or /home/matt/include exist. /home/matt is (obviously) my home directory, and it's the directory into which I installed Qt (qt-everywhere-opensource-src-4.7.1), i.e., that's the directory the Qt folder is in. I did *at one point* have these folders in my home directory, when I was using an earlier version, maybe the same version that didn't fully delete; I'm not sure why they were there, perhaps I installed into the home directory directly by mistake.

    Lastly, I tried changing the HOME and PATH environment variables from /home/matt (default) to /home/matt/qt-everywhere-opensource-src-4.7.1, but it didn't change anything.

    Anyway, anybody know how I can get qmake to generate correct INCPATH and INCLUDE values?

    Matt
    Matt
    Last edited by MattPhillips; 18th March 2011 at 05:53. Reason: More info

  4. #4
    Join Date
    Aug 2009
    Location
    Greece
    Posts
    69
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QtCreator can't find Qt + failed uninstall of earlier version

    First suggestion is you should delete the project's .pro.user file which saves the project's information. Qtcreator will create it again.
    Also since you changed Qt version try to do the "make clean" - "qmake" steps if you haven't done it already.
    Check the Tools-->Options-->Qt4 in Qtcreators menu. Maybe you can delete the obsolete versions.
    Last I'm not sure if it helps but maybe you should check the Trolltech.conf file in ~/.config directory.
    Last edited by Rhayader; 18th March 2011 at 10:49. Reason: add info

  5. #5
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QtCreator can't find Qt + failed uninstall of earlier version

    Hi Rhayader,

    Thanks for your ideas. Deleting the .pro.user file didn't help, and redoing qmake, clean etc. ad infinitum didn't change anything either. The obsolete versions can't be deleted from Tools->Options->Qt4. I did not know/had forgotten about the ~/.config directory, thanks. I couldn't really make heads or tails of the Trolltech.conf file; I found references to older versions but didn't know what I should/shouldn't cut. I also find a Nokia/QtCreator.ini file which let me take out the obsolete Qt versions; but I couldn't find anything anywhere that let me change where Qt looks by default for libraries and files. I even reinstalled QtCreator into the Qt directory (instead of into the home directory), this didn't change anything.

  6. #6
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QtCreator can't find Qt + failed uninstall of earlier version


  7. #7
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QtCreator can't find Qt + failed uninstall of earlier version

    Turns out .qmake.cache was out of date, deleting it solved the problem. See the bug report.

Similar Threads

  1. QtCreator, GDB: Failed...
    By Dovgon in forum Qt Tools
    Replies: 0
    Last Post: 25th January 2011, 13:03
  2. Replies: 7
    Last Post: 4th June 2010, 15:52
  3. QTCreator is using wrong version of nmake
    By mrknight in forum Installation and Deployment
    Replies: 1
    Last Post: 21st May 2010, 04:19
  4. Replies: 5
    Last Post: 15th March 2010, 03:25
  5. How to find out the earliest compatible version of a library?
    By jamadagni in forum General Discussion
    Replies: 2
    Last Post: 29th August 2006, 02:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.