linux 致命错误:“limits”文件未找到#include< limits>

3lxsmp7m  于 2023-10-16  发布在  Linux
关注(0)|答案(2)|浏览(651)

我正在做llvm的测试套件。

[test-suite-build$ make
Consolidate compiler generated dependencies of target fpcmp-target
[  0%] Built target fpcmp-target
Consolidate compiler generated dependencies of target timeit-target
[  0%] Built target timeit-target
[  0%] Built target build-litsupport
[  0%] Built target build-fpcmp
[  0%] Built target build-HashProgramOutput.sh
[  0%] Built target build-timeit
[  0%] Building CXX object Bitcode/Benchmarks/Halide/local_laplacian/CMakeFiles/halide_local_laplacian.dir/driver.cpp.o
In file included from /home/summer/llvm-16/test-suite/Bitcode/Benchmarks/Halide/local_laplacian/driver.cpp:1:
/home/summer/llvm-16/test-suite/Bitcode/Benchmarks/Halide/local_laplacian/../common/benchmark.h:4:10: fatal error: 'limits' file not found
#include <limits>
         ^~~~~~~~
1 error generated.
make[2]: *** [Bitcode/Benchmarks/Halide/local_laplacian/CMakeFiles/halide_local_laplacian.dir/build.make:76: Bitcode/Benchmarks/Halide/local_laplacian/CMakeFiles/halide_local_laplacian.dir/driver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:14272: Bitcode/Benchmarks/Halide/local_laplacian/CMakeFiles/halide_local_laplacian.dir/all] Error 2
make: *** [Makefile:136: all] Error 2](https://stackoverflow.com)

我在/usr/Linux/下找到了limits.h
我重新安装这些库:gcc build-essential manpages-dev make perl zlib1g zlib1g-dev libssl-dev linux-libc-dev
但是不起作用

pw136qt2

pw136qt21#

如果你想在典型的(Ubuntu)Linux中编译C代码,你需要“g”包。

ve7v8dk2

ve7v8dk22#

"limits.h"和C++ <limits>不是一回事。Equivalence of and
否则,您可能会丢失C标准库。Clang doesn't see basic headers
为了确保这一点,首先使用-v标志进行编译,以查看它在哪里查找这些头文件,这样您就可以验证它们是否存在。
确保你已经安装了C
头文件(例如,包名libstdc++)。此外,请确保使用必要的标志(-std=c++-stdlib=libstdc++)编译C++文件。

相关问题