至少从2010年12月开始,MinGW-w64已经与Cygwin一起提供.但是我很难用它来编译几乎任何东西.我已经设置了替代品的符号链接
p=x86_64-w64-mingw32
alternatives \
--install /usr/bin/gcc.exe gcc /usr/bin/$p-gcc.exe 0 \
--slave /usr/bin/ar.exe ar /usr/bin/$p-ar.exe
Run Code Online (Sandbox Code Playgroud)
例如,如果我尝试编译 wget
./configure --without-ssl
make
Run Code Online (Sandbox Code Playgroud)
错误(为简洁起见编辑)
connect.o:connect.c:(.text+0x3f): undefined reference to `__imp_htons'
connect.o:connect.c:(.text+0xbe7): undefined reference to `__imp_ntohs'
connect.o:connect.c:(.text+0xd96): undefined reference to `run_with_timeout'
Run Code Online (Sandbox Code Playgroud)
如果我使用
gcc4-core)然后Wget将编译.
基于ak2答案,这似乎有效
./configure --host=x86_64-w64-mingw32 --disable-ipv6 --without-ssl
make
Run Code Online (Sandbox Code Playgroud)
Cygwin的MinGW-w64编译器是一个交叉编译器,因为它托管在Cygwin上,但目标是MinGW-w64.您只需要configure使用该--target选项告诉它,如下所示:
--target=x86_64-w64-mingw32
Run Code Online (Sandbox Code Playgroud)
这样,make将调用适当的工具.您还需要安装或构建您尝试构建的软件包依赖的任何库的MinGW-w64版本.
弯曲替代系统以便/usr/bin在MinGW-w64上使用工具并不是一个好主意,因为这样你将使用带有Cygwin头文件和库的MinGW工具,这会导致像你上面引用的那样的错误.
| 归档时间: |
|
| 查看次数: |
13417 次 |
| 最近记录: |