工具/软件:
您好:
我想将工具链版本从 ti-cgt-armllvm_3.2.LTS 切换到 ti-cgt-armllvm_4.0.3.LTS 、但无法编译与所使用的相同代码 3.2.2.
在4.0.x 中、编译失败、并出现以下错误:
/opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/cctype:43:5: error: <cctype> tried including <ctype.h> but didn't find libc++'s <ctype.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library. 43 | # error <cctype> tried including <ctype.h> but didn't find libc++'s <ctype.h> header. \ | ^ In file included from main.cpp:4: In file included from <some header path>.hpp:6: In file included from <some header path>.hpp:7: In file included from <some header path>.hpp:8: In file included from /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/functional:526: In file included from /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/__functional/boyer_moore_searcher.h:27: In file included from /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/vector:325: In file included from /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/__format/formatter_bool.h:20: In file included from /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/__format/formatter_integral.h:13: In file included from /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/__charconv/to_chars_integral.h:17: In file included from /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/__charconv/to_chars_result.h:14: In file included from /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/__system_error/errc.h:104: /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1/cerrno:31:5: error: <cerrno> tried including <errno.h> but didn't find libc++'s <errno.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case. 31 | # error <cerrno> tried including <errno.h> but didn't find libc++'s <errno.h> header. \ | ^ 2 errors generated.
问题似乎是由包含路径太多引起的。 我已经通过 使用-E -v 调用/opt/ti-cgt-armllvm_4.0.0.LTS/bin/tiarmclang 来检查了用于编译的包含路径 头文件应该会显示在编译输出中、我可以看到:
ignoring duplicate directory "/opt/ti-cgt-armllvm_4.0.0.LTS/lib/clang/18/include" #include "..." search starts here: #include <...> search starts here: my include paths.... /opt/ti-cgt-armllvm_4.0.0.LTS/include/armv7r-ti-none-eabihf/c++/v1 /opt/ti-cgt-armllvm_4.0.0.LTS/include/c++/v1 /opt/ti-cgt-armllvm_4.0.0.LTS/lib/clang/18/include /opt/ti-cgt-armllvm_4.0.0.LTS/include/c
当我限制用于编译的包含路径数时、问题就消失了。
问题也出现在 4.0.3中
Include 路径编号的数量是否存在任何已知限制? 您能解决我这个问题吗?
此致、
Slawomir