Results 1 to 7 of 7

Thread: [Qt Static build] cc1: error: one or more PCH files were found, but they were invalid

  1. #1
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [Qt Static build] cc1: error: one or more PCH files were found, but they were invalid

    Hi all

    I am getting following error lines when I run :make sub-src :

    cc1: error: .pch/release-static/QtGui: No such file or directory
    cc1: error: one or more PCH files were found, but they were invalid
    cc1: error: use -Winvalid-pch for more information

    ./configure command runs successfully.

    I am not able to figure out (even after googling in google and in qt forum) the reason of the error.



    PS: I don't know whether it's a newbie question or not, so putting this question in newbie thread, to be on safer side, instead of Qt Programming.

  2. #2
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [Qt Static build] cc1: error: one or more PCH files were found, but they were inv

    I forgot to mention, I am using Qt 4.5.1 on ubuntu.

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [Qt Static build] cc1: error: one or more PCH files were found, but they were inv

    PCH is pre-compiled header. Delete them and they'll be rebuilt.

  4. #4
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [Qt Static build] cc1: error: one or more PCH files were found, but they were inv

    Sorry I could not get you completely. You mean to say I should delete the ".pch" folder (in home/qtsdk-2009.02/qt/ ) ?

    I searched for pch in my file system and it showed pch files in many places like qt/include/Qt/private , qt/include/QtCore/private , qt/include/QtDesigner/private , qt/tools/designer/src/lib .. and many more..

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [Qt Static build] cc1: error: one or more PCH files were found, but they were inv

    When you compile an app, the header files are translated to .PCH because it is much faster to read a pre-parsed file than the same text file every time. If a .PCH becomes invalid or corrupt, the easiest way to repair it is to delete it and let the compiler rebuild it.

  6. #6
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [Qt Static build] cc1: error: one or more PCH files were found, but they were inv

    Which pch files should I delete?

    Here is the output of the search "pch" in my file system:

    /home/itteam/qtsdk-2009.02/qt/include/Qt/private/lib_pch.h
    /home/itteam/qtsdk-2009.02/qt/include/Qt/private/qt_compat_pch.h
    /home/itteam/qtsdk-2009.02/qt/include/Qt/private/qt_gui_pch.h
    /home/itteam/qtsdk-2009.02/qt/include/Qt/private/qt_pch.h
    /home/itteam/qtsdk-2009.02/qt/include/Qt3Support/private/qt_compat_pch.h
    /home/itteam/qtsdk-2009.02/qt/include/QtCore/private/qt_pch.h
    /home/itteam/qtsdk-2009.02/qt/include/QtDesigner/private/lib_pch.h
    /home/itteam/qtsdk-2009.02/qt/include/QtGui/private/qt_gui_pch.h
    /home/itteam/qtsdk-2009.02/qt/qmake/qmake_pch.h
    /home/itteam/qtsdk-2009.02/qt/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h
    /home/itteam/qtsdk-2009.02/qt/src/corelib/global/qt_pch.h
    /home/itteam/qtsdk-2009.02/qt/src/gui/kernel/qt_gui_pch.h
    /home/itteam/qtsdk-2009.02/qt/src/qt3support/other/qt_compat_pch.h
    /home/itteam/qtsdk-2009.02/qt/tools/designer/src/components/lib/lib_pch.h
    /home/itteam/qtsdk-2009.02/qt/tools/designer/src/designer/qdesigner_pch.h
    /home/itteam/qtsdk-2009.02/qt/tools/designer/src/lib/lib_pch.h
    /lib/modules/2.6.28-11-generic/kernel/drivers/pci/hotplug/shpchp.ko
    /lib/modules/2.6.28-15-generic/kernel/drivers/pci/hotplug/shpchp.ko
    /lib/modules/2.6.28-16-generic/kernel/drivers/pci/hotplug/shpchp.ko
    /usr/bin/xtrapchar
    /usr/lib/openoffice/basis3.0/program/libucpchelp1.so
    /usr/share/app-install/desktop/gopchop.desktop
    /usr/share/app-install/icons/gopchop.png
    /usr/share/ghostscript/8.64/lib/pcharstr.ps
    /usr/share/man/man1/xtrapchar.1.gz



    But there doesn't seem to be any .pch file. Is that an indicator of some other error ?

  7. #7
    Join Date
    Apr 2009
    Posts
    58
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [Qt Static build] cc1: error: one or more PCH files were found, but they were inv

    Meanwhile I tried ./configure using -no-pch as one of the too many options and then did make sub-src. This way both these worked fine and after this I made a test Qt application compiled it but it did not run on other ubuntu desktop when i transported only executable thus produced.

    On running ldd test on the other ubuntu desktop gives me:
    libQtGui.so.4=>Not Found
    libQtCore.so.4 =>Not Found

    among other non Qt (i guess) libraries whose paths were there after the "=>" sign against their names.


    Which step I am doing wrong?

Similar Threads

  1. Replies: 1
    Last Post: 13th January 2010, 23:35
  2. Moving from QT 4.5 shared build to QT 4.5.2 static build
    By extrakun in forum Qt Programming
    Replies: 0
    Last Post: 26th October 2009, 09:49
  3. error: invalid use of void expression
    By ChineseGeek in forum Qt Programming
    Replies: 17
    Last Post: 3rd October 2009, 08:59
  4. error:invalid use of member
    By quickNitin in forum General Programming
    Replies: 4
    Last Post: 19th June 2006, 15:21
  5. QCanvas Files not found
    By Kapil in forum Installation and Deployment
    Replies: 5
    Last Post: 24th March 2006, 07:36

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.