致命错误:找不到“限制”文件#include <limits>

问题描述 投票:0回答:2

我正在制作 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 开发 linux-libc-dev

但是不起作用

c++ linux clang llvm
2个回答
0
投票

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


0
投票

"limits.h"
和 C++
<limits>
不是一回事。

的等价

否则,您可能缺少 C++ 标准库。 Clang 看不到基本标题

为了确保这一点,请首先使用

-v
标志进行编译,以查看它在哪里寻找这些标头,以便您可以验证它们是否存在。

确保您已安装 C++ 标头(例如包名称

libc++-dev
)。 另外,请确保使用必要的标志编译 C++ 文件(
-std=c++
-stdlib=libstdc++
)。

© www.soinside.com 2019 - 2024. All rights reserved.