Ubuntu 16.04安裝MinGW32(在/etc/apt/sources.list裏添加源)
阿新 • • 發佈:2018-01-15
.html /etc/ arc edi 執行 return lin 一個 linux Ubuntu 16.04下直接使用命令安裝MinGW32:
sudo apt-get install mingw32
但是,會報錯:
Unable to locate package mingw32
解決辦法如下:
sudo gedit /etc/apt/sources.list
//在sources.list末尾添加,保存
deb http://us.archive.ubuntu.com/ubuntu trusty main universe
sudo apt-get update
sudo apt-get install mingw32
測試下是否安裝好了,當然是寫一個test.cpp呀。
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}
在此文件夾下打開終端,輸入命令。
ubuntu下可執行文件後綴為.o結尾的,執行命令為./filename
g++ test.cpp -o test
./test
然後會看見 hello world,結束啦。
本文永久更新地址:http://www.linuxdiyf.com/linux/25274.html
Ubuntu 16.04安裝MinGW32(在/etc/apt/sources.list裏添加源)