Finding include directories in the sysroot
Yann E. MORIN
yann.morin.1998@free.fr
Mon May 20 18:52:00 GMT 2013
Stephen, All,
On 2013-05-20 20:38 +0200, Stephen Kelly spake thusly:
> I have a rootfs which has Qt installed in /usr. So for example, qobject.h
> exists at /usr/include/QtCore/qobject.h.
>
> My rootfs is at ~/rpi/rasp-pi-rootfs.
>
> I invoke
>
> arm-linux-gnueabihf-g++-4.7 --sysroot=/home/stephen/rpi/rasp-pi-rootfs \
> -I/usr/include/QtCore -v -c myfile.cpp
>From the gcc manpage for -I :
-I dir
Add the directory dir to the list of directories to be searched
for header files. Directories named by -I are searched before
the standard system include directories. If the directory dir
is a standard system include directory, the option is ignored
to ensure that the default search order for system directories
and the special treatment of system headers are not defeated.
If dir begins with "=", then the "=" will be replaced by the
sysroot prefix; see --sysroot and -isysroot.
So, absolute paths are just taken as-is. If you want it to be relative
to the sysroot, you have to prepend a '=' sign, as thus (untested):
arm-linux-gnueabihf-g++-4.7 --sysroot=/home/stephen/rpi/rasp-pi-rootfs \
-I=/usr/include/QtCore -v -c myfile.cpp
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list