Building unit_test with including linux file manually using created toolchain

cancel
Showing results for 
Search instead for 
Did you mean: 

Building unit_test with including linux file manually using created toolchain

569 Views
yaolinchang
Contributor I

Hi All,

    We have install toolchain, but if we include <linux/xxx.h>", the result is error.

We have add -I path in compile as below: However, it still can't find linux path.

How can I do?

Test (1) => add -I git/include/linux

14.28-1.0.0/test/mxc_fb_test$ arm-poky-linux-gnueabi-gcc -mfloat-abi=hard -I /home/neo/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/include/linux mxc_fb_test.c -o mxc_fb_testIn file included from /opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/stdio.h:33:0,

                 from mxc_fb_test.c:29:

/home/neo/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/include/linux/stddef.h:4:31: fatal error: uapi/linux/stddef.h: No such file or directory

#include <uapi/linux/stddef.h>

                               ^

compilation terminated.

neo@neo-P45VA:~/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/imx-test/1_3.14.28-1.0.0-r0/imx-test-3.14.28-1.0.0/test/mxc_fb_test$

=======================================================================================================================

Test(2)=> add -I git/include/uapi/linux

14.28-1.0.0/test/mxc_fb_test$ arm-poky-linux-gnueabi-gcc -mfloat-abi=hard -I /home/neo/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/include/uapi/linux -I /home/neo/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/include/linux mxc_fb_test.c -o mxc_fb_testIn file included from /opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/stdio.h:33:0,

                 from mxc_fb_test.c:29:

/home/neo/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/include/uapi/linux/stddef.h:1:28: fatal error: linux/compiler.h: No such file or directory

#include <linux/compiler.h>

                            ^

compilation terminated.

=======================================================================================================================

Test(3) => add -I git/include/linux and -I git/include/uapi/linux

14.28-1.0.0/test/mxc_fb_test$ arm-poky-linux-gnueabi-gcc -mfloat-abi=hard -I /home/neo/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/include/uapi/linux -I /home/neo/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/include/linux mxc_fb_test.c -o mxc_fb_test

In file included from /opt/poky/1.7/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/stdio.h:33:0,

                 from mxc_fb_test.c:29:

/home/neo/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/linux-imx/3.14.28-r0/git/include/uapi/linux/stddef.h:1:28: fatal error: linux/compiler.h: No such file or directory

#include <linux/compiler.h>

                            ^

compilation terminated.

neo@neo-P45VA:~/fsl/build/tmp/work/imx6qsabresd-poky-linux-gnueabi/imx-test/1_3.14.28-1.0.0-r0/imx-test-3.14.28-1.0.0/test/mxc_fb_test$

==================================================================

Thanks,

Best Regards,

Yao

Labels (2)
0 Kudos
2 Replies

89 Views
joanxie
NXP TechSupport
NXP TechSupport

did you install the toolchain successfully , I attach the toolchain release note to you, hope helpful for you

0 Kudos

89 Views
yaolinchang
Contributor I

OK,thank you for your help.

0 Kudos