... 13. repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b fido
@debian:〜$ /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc hello .C hello.c:1:19:致命错误:stdio.h:没有这样的文件或目录 编译终止。
@debian:〜$ arm-poky-linux-gnueabi-gcc hello.c hello.c:1:19:致命错误:stdio.h:没有这样的文件或目录 编译终止。
@debian:〜$ a rm-poky-linux-gnueabi-gcc -I /opt/poky/1.8+snapshot/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/的hello.c 在/opt/poky/1.8+snapshot/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/features.h:389:0中包含的文件中, 来自/opt/poky/1.8+snapshot/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/stdio.h:27, 来自hello.c:1: /opt/poky/1.8+snapshot/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/gnu/stubs.h:7:29:致命错误:gnu / stubs-soft.h:没有这样的文件或目录 编译终止。
使用-v选项交叉编译 @debian:〜$ arm-poky-linux-gnueabi-gcc -v hello.c 使用内置规格。 COLLECT_GCC =臂狭小-Linux的gnueabi-GCC COLLECT_LTO_WRAPPER = /选择/狭小/ 1.8 +快照/ sysroots / x86_64的-pokysdk-的Linux的/ usr /的libexec /臂狭小-Linux的gnueabi / GCC /臂-狭小-Linux的gnueabi / 5.2.0 / LTO-包装 目标:arm-poky-linux-gnueabi 配置为:/arm/fsl-community-bsp-fido/build-sabre/tmp/work-shared/gcc-5.2.0-r0/gcc-5.2.0/configure --build = x86_64-linux --host = x86_64-pokysdk-linux --target = arm-poky-linux-gnueabi --prefix = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / usr --exec_prefix = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / usr --bindir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / usr / bin / arm-poky-linux-gnueabi --sbindir = / opt / poky /1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi --libexecdir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / usr / libexec / arm -poky-linux-gnueabi -datadir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / usr / share --sysconfdir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / etc --sharedstatedir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / com --localstatedir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / var --libdir = /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi --inc ludedir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / usr / include --oldincludedir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / usr / include --infodir = /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir = / opt / poky / 1.8 + snapshot / sysroots / x86_64-pokysdk-linux / usr / share / man - disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot = / arm / fsl-community-bsp-fido / build-saber / tmp / sysroots / x86_64-nativesdk-pokysdk-linux --with- gnu-ld --enable-shared --enable-languages = c,c ++ --enable-threads = posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers = gnu - enable-libstdcxx-pch --program-prefix = arm-poky-linux-gnueabi- --without-local-prefix --enable-target-optspace --enable -lto --enable-libssp --disable-bootstrap - disable-libmudflap --with-system-zlib --with-linker-hash-style = gnu --enable-linker-build-id --with-ppl = no --with-cloog = no --enable-checking = release --enable-cheaders = c_global --without-isl - with-gxx-include-dir = / not / exists / usr / include / c ++ / 5.2.0 --with-build-time-tools = / arm / fsl-community-bsp-fido / build-saber / tmp / sysroots / x86_64-linux / usr / arm-poky-linux-gnueabi / bin - with-sysroot = / not / exists --with-build-sysroot = / arm / fsl-community-bsp-fido / build- saber / tmp / sysroots / imx6qsabresd --enable-poison-system-directories --with -mpfr = / arm / fsl-community-bsp-fido / build-saber / tmp / sysroots / x86_64-nativesdk-pokysdk-linux - with-mpc = / arm / fsl-community-bsp-fido / build-saber / tmp / sysroots / x86_64-nativesdk-pokysdk-linux --enable-nls --with-arch = armv7-a 线程模型:posix gcc 5.2.0版(GCC) COLLECT_GCC_OPTIONS =' -v' ' -march = ARMv7的-A' ' -mtls方言= GNU' /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/cc1 -quiet -v hello。 c -quiet -dumpbase hello.c -march = armv7-a -mtls-dialect = gnu -auxbase hello -version -o /tmp/ccqXSLVK.s GNU C11(GCC)版本5.2.0(arm-poky-linux-gnueabi) 由GNU C版本5.2.0,GMP版本6.0.0,MPFR版本3.1.3,MPC版本1.0.3编译 GGC启发式: - param ggc-min-expand = 100 --param ggc-min-heapsize = 131072 忽略不存在的目录" /not/exist/usr/lib/gcc/arm-poky-linux-gnueabi/5.2.0/include" 忽略不存在的目录" / not / exists / usr / local / include" 忽略不存在的目录" /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/ ../../../../../arm-poky-linux-gnueabi/include" 忽略不存在的目录" / not / exists / usr / include"
/opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/include /opt/poky/1.8+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.2.0/include-fixed 搜索结果列表结束。 GNU C11(GCC)版本5.2.0(arm-poky-linux-gnueabi) 由GNU C版本5.2.0,GMP版本6.0.0,MPFR版本3.1.3,MPC版本1.0.3编译 GGC启发式: - param ggc-min-expand = 100 --param ggc-min-heapsize = 131072 编译器可执行校验和:4d79907806e372d157adce3e5c786751 hello.c:1:19:致命错误:stdio.h:没有这样的文件或目录
我需要一些帮助,使用此处创建的工具链编译一个简单的hello世界。或者我错过了什么。
即使我不确定为什么这些标志设置如下:
- with-gxx-include-dir = / not / exists / usr / include / c ++ / 5.2.0
- with-sysroot = / not / exists
答案 0 :(得分:2)
运行从SDK生成的“env”脚本文件后,默认导出CC,CXX,LDFLAGS等变量标志,
您需要在make文件中或手动使用这些变量。
运行sdk env
@debian:~$ . envoiment file
@debian:~$ echo $CC
arm-poky-linux-gnueabi-gcc -march=armv7ve -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/siva/imx7-images/sdk/meta-toolchain_sdk/sysroots/cortexa7hf-neon-poky-linux-gnueabi
@debian:~$ ${CC} hello.c -o hello
如果您使用c ++文件,则需要使用CXX
@debian:~$ ${CXX} hello.cpp -o hello
它将成功运行。因此,对于每件事,你只能使用宏。
答案 1 :(得分:1)
经过编译
后,尝试了很多选项@debian:〜$ echo $ CC
arm-poky-linux-gnueabi-gcc -march = armv7-a -marm -mthumb-interwork -mfloat-abi = hard -mfpu = neon -mtune = cortex-a9 - SYSROOT = /选择/狭小/ 1.8 / sysroots / cortexa9hf-VFP氖-狭小-Linux的gnueabi
@debian:〜$ $ {CC} hello.c -o out
@debian:〜$ echo $? 0