stdint.h“没有这样的文件或目录”; yocto sdk上的错误 [英] stdint.h "no such file or directory" error on yocto sdk
问题描述
我正在使用Yocto / poky(致命分支)构建系统。
我已将SDK安装在机器(而不是构建机器)上以交叉编译工具。
我为环境加载了
source /opt/mydistro/2.2。 1 / environment-setup-cortexa7hf-neon-vfpv4-poky-linux-gnueabi
构建测试文件
arm-poky-linux-gnueabi-gcc test.cpp
将会失败并显示消息
/opt/mydistro/2.2 .1 / sysroots / x86_64-pokysdk-linux / usr / lib / arm-poky-linux-gnueabi / gcc / arm-poky-linux-gnueabi / 6.2.0 / include / stdint.h:9:26:致命错误: stdint.h:没有这样的文件或目录
#include_next< stdint.h>
使用显式sysroot编译
arm-poky-linux-gnueabi-gcc test.cpp --sysroot = / opt / mydistro / 2.2.1 / sysroots / cortexa7hf-neon-vfpv4-poky-linux-gnueabi /
失败
... include / gnu / stubs.h:7:29:致命错误:gnu / stubs-soft.h:没有此类文件或目录...
为什么这不起作用?什么东西少了?
好吧,由于sysroot-poising,您不能直接使用交叉编译器。请参见 yocto构建的工具链搜索路径问题。 / p>
因此,您应该始终使用 $ CC
而不是直接使用交叉编译器。使用 $ CC
不仅会指定sysroot,还会指定 -march = ...
, -mfloat-abi = ...
, -mtune = ...
等(选项的确切数量取决于您要建造的机器)。那应该已经解决了您所有的问题。
I'm building an System with Yocto/poky (morty branch). Building the image and the sdk works fine.
I've installed the SDK on an machine (other than the build machine) to cross compile a tool.
I've loaded the environment with
source /opt/mydistro/2.2.1/environment-setup-cortexa7hf-neon-vfpv4-poky-linux-gnueabi
Building a test file with
arm-poky-linux-gnueabi-gcc test.cpp
will fail with message
/opt/mydistro/2.2.1/sysroots/x86_64-pokysdk-linux/usr/lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.2.0/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
Compilation with explicit sysroot
arm-poky-linux-gnueabi-gcc test.cpp --sysroot=/opt/mydistro/2.2.1/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/
fails with
... include/gnu/stubs.h:7:29: fatal error: gnu/stubs-soft.h: No such file or directory ...
Why is this not working? What is missing?
Well, that you can't directly use the cross-compiler is due to sysroot-poising. See yocto built tool chain search path issue.
Thus, you should always use $CC
instead of directly using the cross-compiler. Using $CC
will not only specify the sysroot, but also specify things like -march=...
, -mfloat-abi=...
, -mtune=...
, etc (the exact number of options is depending on what machine you're building for). That should have solved all your problems.
这篇关于stdint.h“没有这样的文件或目录”; yocto sdk上的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!