PDA

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



anupamgee
6th April 2010, 07:22
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.

anupamgee
6th April 2010, 08:59
I forgot to mention, I am using Qt 4.5.1 on ubuntu.

squidge
6th April 2010, 09:02
PCH is pre-compiled header. Delete them and they'll be rebuilt.

anupamgee
7th April 2010, 07:05
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..

squidge
7th April 2010, 08:54
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.

anupamgee
8th April 2010, 06:56
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 ?

anupamgee
8th April 2010, 09:04
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?