fatal error: bits/c++config.h: No such file or directory
test2.cpp代码#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 100 + 10;
int A;
int main()
{
long long a, b;
while (cin >> a >> b)
{
cout << min(a, b) << "\n";
}
return 0;
}
我想在linux编译test2.cpp这个文件,但是会出现
In file included from test2.cpp:1:0:
/usr/include/c++/4.8.2/iostream:38:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
这个错误
代码全部复制下来到devcpp却可以编译运行
不知道怎么解决这个问题 xg-sco 发表于 2021-8-9 22:20
还真有这个文件
g++ -I /usr/include/c++/4.8.2/i686-redhat-linux test2.cpp
在别的网站上找到的办法是输入
sudo apt-get install gcc-multilib g++-multilib
sudo apt-get install gcc-4.8-multilib g++-4.8-multilib
得到的结果是sudo: apt-get: command not found{:10_266:} xg-sco 发表于 2021-8-9 20:14
在别的网站上找到的办法是输入
先进入特权模式再
install gcc-4.8-multilib g++-4.8-multilib 大马强 发表于 2021-8-9 20:17
先进入特权模式再
install gcc-4.8-multilib g++-4.8-multilib
我这已经是特权模式了,但是gcc-4.8-multilib g++-4.8-multilib要怎么安装
输入install gcc-4.8-multilib g++-4.8-multilib
得到install: cannot stat ‘gcc-4.8-multilib’: No such file or directory
加个yum也安装不成功
yum install gcc-4.8-multilib g++-4.8-multilib
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.ustc.edu.cn
* extras: mirrors.ustc.edu.cn
* updates: mirrors.ustc.edu.cn
No package gcc-4.8-multilib available.
No package g++-4.8-multilib available.
Error: Nothing to do
xg-sco 发表于 2021-8-9 20:34
我这已经是特权模式了,但是gcc-4.8-multilib g++-4.8-multilib要怎么安装
输入
知识盲区,蹲大佬吧{:10_266:} ls /
ls /usr/include/c++
人造人 发表于 2021-8-9 20:40
# ls /
binbootdevetchomeliblib64mediamntoptprocrootrunsbinsrvsystmpusrvar
# ls /usr/include/c++
4.8.24.8.5
g++ --version 人造人 发表于 2021-8-9 20:43
# g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
这是我g++没有安装好来吗? ls /usr/include/c++/4.8.2/bits/c++config.h
ls /usr/include/c++/4.8.5/bits/c++config.h g++ -v test2.cpp 人造人 发表于 2021-8-9 20:46
# ls /usr/include/c++/4.8.2/bits/c++config.h
ls: cannot access /usr/include/c++/4.8.2/bits/c++config.h: No such file or directory
# ls /usr/include/c++/4.8.5/bits/c++config.h
ls: cannot access /usr/include/c++/4.8.5/bits/c++config.h: No such file or directory
ls /usr/include/c++/4.8.2/bits/
ls /usr/include/c++/4.8.5/bits/
人造人 发表于 2021-8-9 20:49
# ls /usr/include/c++/4.8.2/bits/
algorithmfwd.h hash_bytes.h regex_constants.h stl_numeric.h
allocator.h hashtable.h regex_cursor.h stl_pair.h
alloc_traits.h hashtable_policy.h regex_error.h stl_queue.h
atomic_base.h indirect_array.h regex_grep_matcher.h stl_raw_storage_iter.h
atomic_lockfree_defines.hios_base.h regex_grep_matcher.tcc stl_relops.h
basic_ios.h istream.tcc regex.h stl_set.h
basic_ios.tcc list.tcc regex_nfa.h stl_stack.h
basic_string.h locale_classes.h regex_nfa.tcc stl_tempbuf.h
basic_string.tcc locale_classes.tcc shared_ptr_base.h stl_tree.h
boost_concept_check.h locale_facets.h shared_ptr.h stl_uninitialized.h
c++0x_warning.h locale_facets_nonio.h slice_array.h stl_vector.h
char_traits.h locale_facets_nonio.tccsstream.tcc streambuf_iterator.h
codecvt.h locale_facets.tcc stl_algobase.h streambuf.tcc
concept_check.h localefwd.h stl_algo.h stream_iterator.h
cpp_type_traits.h mask_array.h stl_bvector.h stringfwd.h
cxxabi_forced.h memoryfwd.h stl_construct.h unique_ptr.h
deque.tcc move.h stl_deque.h unordered_map.h
exception_defines.h nested_exception.h stl_function.h unordered_set.h
exception_ptr.h ostream_insert.h stl_heap.h uses_allocator.h
forward_list.h ostream.tcc stl_iterator_base_funcs.hvalarray_after.h
forward_list.tcc postypes.h stl_iterator_base_types.hvalarray_array.h
fstream.tcc ptr_traits.h stl_iterator.h valarray_array.tcc
functexcept.h random.h stl_list.h valarray_before.h
functional_hash.h random.tcc stl_map.h vector.tcc
gslice_array.h range_access.h stl_multimap.h
gslice.h regex_compiler.h stl_multiset.h
# ls /usr/include/c++/4.8.5/bits/
algorithmfwd.h hash_bytes.h regex_constants.h stl_numeric.h
allocator.h hashtable.h regex_cursor.h stl_pair.h
alloc_traits.h hashtable_policy.h regex_error.h stl_queue.h
atomic_base.h indirect_array.h regex_grep_matcher.h stl_raw_storage_iter.h
atomic_lockfree_defines.hios_base.h regex_grep_matcher.tcc stl_relops.h
basic_ios.h istream.tcc regex.h stl_set.h
basic_ios.tcc list.tcc regex_nfa.h stl_stack.h
basic_string.h locale_classes.h regex_nfa.tcc stl_tempbuf.h
basic_string.tcc locale_classes.tcc shared_ptr_base.h stl_tree.h
boost_concept_check.h locale_facets.h shared_ptr.h stl_uninitialized.h
c++0x_warning.h locale_facets_nonio.h slice_array.h stl_vector.h
char_traits.h locale_facets_nonio.tccsstream.tcc streambuf_iterator.h
codecvt.h locale_facets.tcc stl_algobase.h streambuf.tcc
concept_check.h localefwd.h stl_algo.h stream_iterator.h
cpp_type_traits.h mask_array.h stl_bvector.h stringfwd.h
cxxabi_forced.h memoryfwd.h stl_construct.h unique_ptr.h
deque.tcc move.h stl_deque.h unordered_map.h
exception_defines.h nested_exception.h stl_function.h unordered_set.h
exception_ptr.h ostream_insert.h stl_heap.h uses_allocator.h
forward_list.h ostream.tcc stl_iterator_base_funcs.hvalarray_after.h
forward_list.tcc postypes.h stl_iterator_base_types.hvalarray_array.h
fstream.tcc ptr_traits.h stl_iterator.h valarray_array.tcc
functexcept.h random.h stl_list.h valarray_before.h
functional_hash.h random.tcc stl_map.h vector.tcc
gslice_array.h range_access.h stl_multimap.h
gslice.h regex_compiler.h stl_multiset.h
g++ -v test2.cpp yum list | grep gcc
人造人 发表于 2021-8-9 20:54
人造人 发表于 2021-8-9 20:54
# yum list | grep gcc
gcc.x86_64 4.8.5-44.el7 @base
gcc-c++.x86_64 4.8.5-44.el7 @base
libgcc.i686 4.8.5-44.el7 @base
libgcc.x86_64 4.8.5-44.el7 @anaconda
compat-gcc-44.x86_64 4.4.7-8.el7 base
compat-gcc-44-c++.x86_64 4.4.7-8.el7 base
compat-gcc-44-gfortran.x86_64 4.4.7-8.el7 base
gcc-gfortran.x86_64 4.8.5-44.el7 base
gcc-gnat.x86_64 4.8.5-44.el7 base
gcc-go.x86_64 4.8.5-44.el7 base
gcc-objc.x86_64 4.8.5-44.el7 base
gcc-objc++.x86_64 4.8.5-44.el7 base
gcc-plugin-devel.x86_64 4.8.5-44.el7 base
relaxngcc.noarch 1.12-6.el7 base
relaxngcc-javadoc.noarch 1.12-6.el7 base
yum search build-essential
yum search gcc