1、安装 mingw32
sudo gedit /etc/apt/sources.list
//在sources.list末尾添加,保存
deb http://us./ubuntutrusty main universe
sudo apt-get update
sudo apt-get install mingw32
2、安装 准备环境
apt-get install mingw32 dpkg-dev pkg-config wget libglib2.0-dev unziplibtool automake autoconf m4 gettext cvs flex bison wine git-core subversionpatch
3、安装64位支持库
sudo apt install libc6:i386
sudo apt install libstdc++6:i386
或者直接安装gcc-multilib解决问题(推荐使用此方法)
sudo apt install gcc-multilib
4、安装库
问题:安装好交叉编译器后,输入命令却出现 “没有那个文件或目录”
原因是交叉编译器一般是32位的,而64位系统缺少一些32位库的支持,所以需要安装32位库。
解决方法:
sudo apt-get installlib32ncurses5 lib32z1
5、安装编译软件autotools系列工具
sudo apt-getinstall autoconf
6、安装libtool
sudo apt-getinstall libtool
7、装对应平台gcc
sudo apt-getinstall i686-w64-mingw32-gcc
8、安装库
sudo apt-get install gawk
sudo apt-get install bison
apt-get update 或者加上--fix-missing
sudo apt-get install byacc
sudo apt-get install flex
9、编译configure
autoscan (可选)
aclocal
autoconf
autoheader(可选)
libtoolize --automake --copy --debug --force(可选)
automake --add-missing
autoreconf –f –i –Wall,no–obsolete(可选)
./configure
如果觉得《ubuntu下mingw32交叉编译环境搭建》对你有帮助,请点赞、收藏,并留下你的观点哦!