Bug 3409

Summary: meta-toolchain-qte fails to find c++ headers when relocated
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Eric Bénard <eric>
Component: devtools / tool chainAssignee: Laurentiu Palcu <laurentiu.palcu>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, meta.mr.watcher, meta.watcher
Version: 1.3   
Target Milestone: 1.4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
qt helloworld none

Description Eric Bénard 2012-11-12 16:02:56 UTC
Created attachment 938 [details]
qt helloworld

After compiling meta-toolchain-qte with danny for an armv7 :

- if I install the sdk in $HOME/WORK/test/sdk
then I try to compile a helloworld QT project with qmake, make, that fails with :
/home/ebenard/WORK/test/sdk/sysroots/armv7a-vfp-neon-oe-linux-gnueabi//usr/include/qtopia/QtCore/qglobal.h:68:21: fatal error: algorithm: No such file or directory
of course the file is there.

- if I install the sdk in /usr/local/oecore-x86_64/
then the same project compiles fine (and runs fine on the target).

so it seems there is an issue to find the headers when the SDK is relocated.
Comment 1 Laurentiu Palcu 2012-11-23 08:38:07 UTC
You're probably missing the --sysroot option. I compiled your application just fine with the following line:

$ $CXX -I$OE_QMAKE_INCDIR_QT -I$OE_QMAKE_INCDIR_QT/QtGui -L$OE_QMAKE_LIBDIR_QT $OE_QMAKE_LDFLAGS -o test test.cpp -lQtGuiE -lQtCoreE

$CXX has the --sysroot included. However, $OE_QMAKE_CXX doesn't. So, you'll have to provide it the --sysroot option. If the --sysroot is missing then I get the error you specified in the bug description.

Install in the default location will work because the toolchain has been compiled with a default sysroot.
Comment 2 Eric Bénard 2012-11-23 08:41:16 UTC
Shouldn't we expect the --sysroot option to be automatically added in
the SDK's environment variables when relocating it so that the end user
doesn't have to take care of that ?
Comment 3 Laurentiu Palcu 2012-11-23 08:53:32 UTC
CXX variable has --sysroot included. This is not a relocation issue. This is just OE_QMAKE_CXX/OE_QMAKE_CC not including the --sysroot option. I'll send a patch for that.
Comment 4 Laurentiu Palcu 2012-11-23 08:57:13 UTC
Even though this has nothing to do with relocating the SDK, I agree that the --sysroot has to ba included. So, reopening the issue and will send a patch shortly.
Comment 5 Eric Bénard 2012-11-23 08:57:58 UTC
OK thanks I understand better now and sorry for the wrong diagnotic.
Comment 6 Laurentiu Palcu 2012-11-23 13:22:47 UTC
Patch for adding --sysroot to OE_QMAKE_CC/OE_QMAKE_CXX was sent to the mailing list. Review pending...