我在vmware上安装了Linux opensuse,并希望在终端中编译C ++程序。我从这里安装了gcc c ++编译器
https://software.opensuse.org/package/gcc-c++
但是,即使在编译简单的hello world代码时,我仍然无法编译并出现某种错误:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!";
return 0; }
这是我得到的错误
vaibhaw@linux-xn99:~/CPP> vi helloworld.cpp vaibhaw@linux-xn99:~/CPP> g++ helloworld.cpp /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc.a(_muldi3.o): unable to initialize decompress status for section .debug_info
一个简单的'zccper in gcc-c ++'就会从安装和更新存储库中提取所有需要的包。无需使用software.opensuse.org网站。