MinGW g++ 在包含它的文件所在的包含文件夹中找不到 _G_config.h



我正在尝试使用MinGW g++进行交叉编译,在系统包含文件夹中查找文件似乎存在选择性问题。

它发现stdio.h很好,发现libio.h很好,但它找不到_G_config.h,即使这三个文件都在同一文件夹中,具有相同的权限,以相同的方式包含。

以下是详细的输出(展开以使其清晰可见;删除用户名(:

-Documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbinarm-linux-gnueabihf-g++.exe -v -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"MainSPI.d" -MT"MainSPI.o" -o "MainSPI.o" "../MainSPI.cpp"
Using built-in specs.
COLLECT_GCC=C:Usersuser-------------Documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbinarm-linux-gnueabihf-g++.exe
Target: arm-linux-gnueabihf
Configured with: /home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/snapshots/gcc-linaro-5.3-2016.02/configure
SHELL=/bin/bash --with-bugurl=https://bugs.linaro.org --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32 --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32 --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32 --with-gnu-as --with-gnu-ld --disable-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-multilib --enable-multiarch --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/sysroots/arm-linux-gnueabihf --enable-lto --enable-linker-build-id --enable-long-long --enable-shared --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran,lto --enable-checking=release --disable-bootstrap --with-bugurl=https://bugs.linaro.org --build=x86_64-unknown-linux-gnu --host=i686-w64-mingw32 --target=arm-linux-gnueabihf --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32
Thread model: posix
gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02)
COLLECT_GCC_OPTIONS='-v' '-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-MMD' '-MP' '-MF' 'MainSPI.d' '-MT' 'MainSPI.o' '-o' 'MainSPI.o' '-shared-libgcc' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu'
c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/5.3.1/cc1plus.exe -quiet -v -imultilib . -imultiarch arm-linux-gnueabihf -iprefix c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../lib/gcc/arm-linux-gnueabihf/5.3.1/ -isysroot c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../arm-linux-gnueabihf/libc -MMD MainSPI.d -MF MainSPI.d -MP -MT MainSPI.o -dD -D_GNU_SOURCE ../MainSPI.cpp -quiet -dumpbase MainSPI.cpp -march=armv7-a -mtune=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -mtls-dialect=gnu -auxbase-strip MainSPI.o -g3 -O0 -Wall -version -fmessage-length=0 -o
C:UsersuserAppDataLocalTempcce7dljB.s
GNU C++ (Linaro GCC 5.3-2016.02) version 5.3.1 20160113 (arm-linux-gnueabihf)
compiled by GNU C version 4.9.1, GMP version 6.0.0, MPFR version 3.1.3,
MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1"
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1/arm-linux-gnueabihf/."
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1/backward"
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/include"
ignoring nonexistent directory "c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../arm-linux-gnueabihf/libc/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32/lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../include/arm-linux-gnueabihf"
ignoring nonexistent directory "c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../arm-linux-gnueabihf/libc/home/tcwg-buildslave/workspace/tcwg-make-release/label/tcwg-x86_64-ex40/target/arm-linux-gnueabihf/_build/builds/destdir/i686-w64-mingw32/lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../include"
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed"
ignoring duplicate directory "c:/users/user-------------/documents/case-sensitive/gcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihf/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1/arm-linux-gnueabihf/.
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include/c++/5.3.1/backward
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../lib/gcc/arm-linux-gnueabihf/5.3.1/include
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../lib/gcc/arm-linux-gnueabihf/5.3.1/include-fixed
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/include
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../arm-linux-gnueabihf/libc/usr/include/arm-linux-gnueabihf
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfbin../arm-linux-gnueabihf/libc/usr/include
End of search list.
GNU C++ (Linaro GCC 5.3-2016.02) version 5.3.1 20160113 (arm-linux-gnueabihf)
compiled by GNU C version 4.9.1, GMP version 6.0.0, MPFR version 3.1.3,
MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d41011bf5dc0e7b64084b0a5dc2942fd
In file included from c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfarm-linux-gnueabihflibcusrincludestdio.h:75:0,
from ../MainSPI.cpp:4:
c:usersuser-------------documentscase-sensitivegcc-linaro-5.3-2016.02-i686-mingw32_arm-linux-gnueabihfarm-linux-gnueabihflibcusrincludelibio.h:32:23:
fatal error: _G_config.h: No such file or directory
compilation terminated.

这是我的双重检查,是的,文件在第8个/最后一个搜索目录:

...abihf/arm-linux-gnueabihf/libc/usr/include$ ls -l _G_config.h stdio.h libio.h
-rwxrwxrwx 1 root root  2526 Jun 19  2017 _G_config.h
-rwxrwxrwx 1 root root 17790 Jun 19  2017 libio.h
-rwxrwxrwx 1 root root 31525 Jun 19  2017 stdio.h
...abihf/arm-linux-gnueabihf/libc/usr/include$ sed -n '32p' libio.h
#include <_G_config.h>
...abihf/arm-linux-gnueabihf/libc/usr/include$ sed -n '75p' stdio.h
#include <libio.h>

我认为这不相关,但这是在启用了WSL的Windows 10上,并且我为文件夹case-sensitive启用了区分大小写的文件系统。

至于我的实际问题:为什么g++找不到_G_config.h,我如何修复它?

我不确定这是否是答案。但是,我在Linaro GCC 5.5.0-2017.10中遇到了类似的情况,结果发现这是Windows上的路径长度问题。你也可能是这样,因为找不到的文件的名称比找到的两个文件的名称长(就像我的情况一样(。测试很简单,从目录结构中删除一些级别(出于此测试的目的([例如,只需移动基本文件夹或项目,或用较短的名称重命名其中的部分],然后查看构建是否开始工作。

相关内容

  • 没有找到相关文章

最新更新