Home

[icon] 超越无限的blog
View:Recent Entries.
View:Archive.
View:Friends.
View:User Info.
You're looking at the latest 1 entries.

Tags:, , ,
Subject:在Gentoo上构建windows交叉编译环境
Time:11:48 am
最近公司开发一款跨平台的产品,主要支持的平台包括linux和windows,由于我的日常工作操作系统是linux,因此要调试windows部分代码极其不方便,要么在linux下安装一个虚拟机跑windows,要么双系统重启机器进入windows,总之是比较费时且麻烦。于是不安份的情绪让我折腾了一上午时间,终于成功地在我的Gentoo Linux上构建好了windows交叉编译环境。

其实在Gentoo Linux上构建交叉编译环境非常方便,crossdev一行命令就搞定一切,关于crossdev的用法很简单,可以参考Gentoo官方网站或者Gentoo-Wiki网站上的相关文档。构建windows交叉编译环境直接执行crossdev i686-mingw32即可。

构建好交叉编译环境之后可以写个hello world程序尝试一下,i686-mingw32-gcc -o test.exe test.c,然后file test.exe即可看到文件类型为“MS-DOS executable PE for MS Windows (console) Intel 80386 32-bit”,你也可以用wine test.exe执行一下看看结果。

似乎到此就圆满结束了?为了更方便地进行交叉编译,继续往下看吧。。。
Read more... )
comments: 1 comment or Leave a comment Add to Memories Tell a Friend

Advertisement

[icon] 超越无限的blog
View:Recent Entries.
View:Archive.
View:Friends.
View:User Info.
You're looking at the latest 1 entries.