arm-linux-gnueabi会跳过PWD中的一些标题?

时间:2014-09-28 19:48:21

标签: linux g++ cross-compiling header-files

我正在尝试在安装了软件包gcc-arm-linux-gnueabig++-arm-linux-gnueabi的Ubuntu 14.04上编译库。

编译在遇到的第一个源文件上失败:

/usr/bin/arm-linux-gnueabi-g++ -DNDEBUG -g2 -Os -pipe -fPIC -I. -DCRYPTOPP_DISABLE_ASM 
-mcpu=cortex-m3 -mthumb --sysroot=/usr/arm-linux-gnueabi -c 3way.cpp
In file included from cryptlib.h:83:0,
                 from seckey.h:8,
                 from 3way.h:7,
                 from 3way.cpp:5:
stdcpp.h:14:18: fatal error: memory: No such file or directory
compilation terminated.

以下是cryptlib.h中包含行的内容:

#ifndef CRYPTOPP_CRYPTLIB_H
#define CRYPTOPP_CRYPTLIB_H

#include "config.h"
#include "stdcpp.h"
...

显然,stdcpp.h存在:

$ pwd
/home/jwalton/cryptopp-embedded
$ ls 3way.h cryptlib.h stdcpp.h
3way.h  cryptlib.h  stdcpp.h

添加-v会显示:

...
ignoring nonexistent directory "/usr/arm-linux-gnueabi/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/include
...
End of search list.

我已经在其他平台(如Android,iOS和Windows Phone)上交叉编译了库,所以我很清楚需要做什么。这是我第一次使用arm-linux-gnueabi

为什么arm-linux-gnueabi跳过当前工作目录中的标题?我该如何解决这个问题?


arm-linux-gnueabi-g++ -v的完整输出:

/usr/bin/arm-linux-gnueabi-g++ -v -DNDEBUG -g2 -Os -pipe -fPIC -I. -DCRYPTOPP_DISABLE_ASM
-mcpu=cortex-m3 -mthumb --sysroot=/usr/arm-linux-gnueabi -c 3way.cpp
Using built-in specs.
COLLECT_GCC=/usr/bin/arm-linux-gnueabi-g++
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.3-12ubuntu1'
 --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++
--prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.7.3
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-gnu-unique-object
--disable-libmudflap --disable-libitm --enable-plugin --with-system-zlib --enable-objc-gc --with-cloog
--enable-cloog-backend=ppl --disable-cloog-version-check --disable-ppl-version-check --enable-multiarch --enable-multilib
--disable-sjlj-exceptions --with-arch=armv5t --with-float=soft --disable-werror --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueab --program-prefix=arm-linux-gnueabi-
--includedir=/usr/arm-linux-gnueabi/include
Thread model: posix
gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) 
COLLECT_GCC_OPTIONS='-v' '-D' 'NDEBUG' '-g2' '-Os' '-pipe' '-fPIC' '-I' '.' '-D' 'CRYPTOPP_DISABLE_ASM'
'-mcpu=cortex-m3' '-mthumb' '-c' '-shared-libgcc' '-mfloat-abi=soft' '-mtls-dialect=gnu'
 /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/cc1plus -quiet -v -I . -imultilib sf -imultiarch 
arm-linux-gnueabi
-isysroot /usr/arm-linux-gnueabi -D_GNU_SOURCE -D NDEBUG -D CRYPTOPP_DISABLE_ASM
3way.cpp -quiet
-dumpbase 3way.cpp -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -mtls-dialect=gnu -auxbase 3way
-g2 -Os -version -fPIC -fstack-protector -o - |
 /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/bin/as -v -I . -mcpu=cortex-m3
-mfloat-abi=soft -meabi=5 -o 3way.o
GNU assembler version 2.24 (arm-linux-gnueabi) using BFD version (GNU Binutils for Ubuntu) 2.24
GNU C++ (Ubuntu/Linaro 4.7.3-12ubuntu1) version 4.7.3 (arm-linux-gnueabi)
    compiled by GNU C version 4.8.2, GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/arm-linux-gnueabi/usr/arm-linux-gnueabi/include/c++/4.7.3"
ignoring nonexistent directory "/usr/arm-linux-gnueabi/usr/arm-linux-gnueabi/include/c++/4.7.3/arm-linux-gnueabi/sf"
ignoring nonexistent directory "/usr/arm-linux-gnueabi/usr/arm-linux-gnueabi/include/c++/4.7.3/backward"
ignoring nonexistent directory "/usr/arm-linux-gnueabi/usr/local/include/arm-linux-gnueabi"
ignoring nonexistent directory "/usr/arm-linux-gnueabi/usr/include/arm-linux-gnueabi"
ignoring nonexistent directory "/usr/arm-linux-gnueabi/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/include
 /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/include-fixed
 /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/include
End of search list.
GNU C++ (Ubuntu/Linaro 4.7.3-12ubuntu1) version 4.7.3 (arm-linux-gnueabi)
    compiled by GNU C version 4.8.2, GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: dd2bb0d8e9ec09589fb3eaca028d0191
In file included from cryptlib.h:83:0,
                 from seckey.h:8,
                 from 3way.h:7,
                 from 3way.cpp:5:
stdcpp.h:14:18: fatal error: memory: No such file or directory
compilation terminated.
make: *** [3way.o] Error 1

1 个答案:

答案 0 :(得分:0)

  

stdcpp.h:14:18:致命错误:内存:没有这样的文件或目录

Arg ...缺少的标头是memory,而不是stdcpp.h。 (该死的C ++标题名称......)。

未找到的<memory>似乎是Ubuntu的g++arm-linux-gnueabig++-arm-linux-gnueabi cannot compile a C++ program with --sysroot中的错误。