0

我下载了 Mobaxterm 以使用 Bash shell。问题是,我无法用“cc -o file file.c”编译我的 C 文件。它向我展示了这一点:

找不到命令“cc”,但可以安装:

sudo apt install gcc

sudo apt install clang

sudo apt install pentium-builder

sudo apt install tcc

但是每当我键入这些命令时,它都会返回错误消息,例如:

Ign:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 linux-libc-dev
amd64 4.15.0-29.31
Err:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 linux-libc-dev
 amd64 4.15.0-29.31
  404  Not Found [IP: 91.189.88.162 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.15.0-29.31_amd64.deb  404  Not Found [IP: 91.189.
88.162 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
mainuser@DESKTOP-AN5KMJ2:/mnt/c/Users/LEPCDC~1/Desktop$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
4

1 回答 1

-1

Go to Plugin section of the website and download plugin Gcc, G++ and development tools: the GNU C/C++ compiler and other development tools. It'll download a file named Development.mxt3 Now go to C:\Program Files (x86)\Mobatek\MobaXterm\ folder and paste the downloaded file here. Copying the plugin file here

Open the application's terminal and by now you'll be able to compile

cc -o file file.c

and run as follows

./file.exe

compile & run

于 2018-12-26T14:02:08.857 回答