C++libc配置

参考的是这篇文章

  • 方法一 直接在相应的ubuntu版本下写题
  • 方法二 在相应的ubuntu中创建C++文件,并且g++ -g test.cpp -o test,然后直接去指向的文件找copy其中的libc文件
  1. cp /lib/x86_64-linux-gnu/libstdc++.so.6 ~/libstdc++.so.6
  2. docker cp 9356a578cce7:/root/libstdc++.so.6 C:\Users\ZP\Desktop
  3. Successfully copied 2.52MB to C:\Users\ZP\Desktop
//C++
#include<iostream>
using namespace std;

int main(){
    cout<<"Hello world"<<endl;
    return 0;    
}

  • 方法三
  1. docker run -it ubuntu:20.04 /bin/bash
  2. apt update
  3. apt install build-essential
  4. 安装vim然后像方法二一样做即可