如何更改 eclipse cdt mingw32 中的内置工具链
我正在 Windows 上使用 cdt/mingw 进行编译。我喜欢编译无警告。我收到以下警告:
auto-importing has been activated without --enable-auto-import specified
on the command line.
以下页面建议处理该问题的方法是将该选项添加到 ld 的命令行中。
问题是,如何更改内置工具链的默认命令行开关?
我还想设置gcc的警告级别。
I am compiling on windows with cdt/mingw. I like to compile warning free. I get the following warning:
auto-importing has been activated without --enable-auto-import specified
on the command line.
The following page suggests the way to deal with it is to just adding that option to the command line of ld.
4.8 ld and WIN32 (cygwin/mingw)
The question is thus, how do you change the default command line switches for the built in toolchains?
I would also like to set the warning level of gcc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须通过 gcc 的
-Wl
参数:所以,你需要(我也是:))
-Wl,--enable-auto-import
。有关控制警告级别的信息,请参阅官方文档。
You have to send the parameter to the linker via gcc's
-Wl
parameter:So, you need (and me too :))
-Wl,--enable-auto-import
.For controlling warning levels, see the official docs.
您好,到目前为止我已经找到了这个问题的部分解决方案。我还没有找到如何更改默认工具链选项,但我找到了如何在项目的基础上更改它们。
在project->properties->C++-build->settings中,
如果它位于工具链编辑器中似乎更有意义,但事实并非如此。
那里有一个名为工具设置的选项卡,向下看有MinGW C++ Linker->Miscellaneous。
在右侧,您可以添加额外的链接器选项。上面还有编译器和警告设置作为复选框实现,这很好。
到目前为止,至少我已经开始了,唯一遗憾的是我必须为每个项目单独做一遍。
哦,为了进一步混淆,这并不总是存在,而且我在安装 MinGW 之前有一些旧项目,因此没有安装真正的工具链。在这种情况下,设置窗格只有“二进制解析器”和“错误解析器”选项卡,因此看起来完全不同。秘密在于“工具设置”选项卡。非常动态,并且像雨林一样的 Eclipse 设置对话框也非常令人困惑。
Hi so far I have found a partial solution to this problem. I have not found how I can change the default toolchain options, but I have found how to change them on a project basis.
In project->properties->C++-build->settings
It seems to make more sense if it would be in tool chain editor, but it isn't.
There you have a tab called Tool Settings and looking down there is MinGW C++ Linker->Miscellaneous.
Here on the right you can add extra linker options. Above you also have the compiler and warning settings are implemented as checkboxes which is nice.
So far at least I have gotten started, only a pity I have to do that over for every project individually.
Oh for further confusion, this is not always there, and I have some old projects from before I installed MinGW and who thus have no real toolchain installed. In that case the settings pane only has the Binary Parsers and Error Parsers tabs, so it looks completely different. The secret is in having the Tool Settings Tab. Very dynamic and for the rainforest like settings dialog of eclipse also very confusing.