使用 Cygwin 工具链时出现链接错误
我需要使用 Cygwin 为 Android 项目编译 C++ 代码。我什至无法编译基本的“hello world”程序。控制台给我这条消息:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: unrecognized -a option “ware”
我用谷歌搜索了这个错误,我发现的唯一结果是其中一个程序(我认为是 binutils)过时了,并且在更新该程序时得到了解决。我立即下载了整个 Cygwin 软件包,所以我不认为这是问题所在。编译器和链接器无法正常通信。如何在不更改编译器的情况下修复它?
I need to use Cygwin to compile C++ code for an Android project. I'm having trouble compiling even a basic "hello world" program. The console gives me this message:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: unrecognized -a option `ware'
I've googled the error and the only result I've found was an issue with one of the programs (I think it was binutils) being out of date, and was resolved when that program was updated. I downloaded the entirety of the Cygwin package at once, so I don't think that's the problem. The compiler and linker aren't communicating properly. How do I fix it without changing compilers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了 - Android 不支持标准 C++ 库。通过下载 http://www.crystax.net/android/ndk-r4.php 修复
这基本上为 Android 重新实现了这一点。
I figured it out - Android doesn't support the standard C++ library. Fixed by downloading http://www.crystax.net/android/ndk-r4.php
Which basically reimplements that for Android.