Ubuntu 16.04安裝MinGW32(在/etc/apt/sources.list里添加源)


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
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM