如何更改 eclipse cdt mingw32 中的内置工具链

发布于 2024-10-01 02:21:55 字数 399 浏览 4 评论 0原文

我正在 Windows 上使用 cdt/mingw 进行编译。我喜欢编译无警告。我收到以下警告:

auto-importing has been activated without --enable-auto-import specified
on the command line.

以下页面建议处理该问题的方法是将该选项添加到 ld 的命令行中。

4.8 ld 和 WIN32 (cygwin/mingw)

问题是,如何更改内置工具链的默认命令行开关?

我还想设置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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷离° 2024-10-08 02:21:55

您必须通过 gcc 的 -Wl 参数

-Wl选项

选项作为选项传递给链接器。如果选项包含逗号,
它被分为多个选项
逗号。您可以使用此语法
将参数传递给选项。为了
例如,-Wl,-Map,output.map 传递
-将output.map映射到链接器。什么时候
使用GNU链接器,你还可以得到
与相同的效果
-Wl,-Map=output.map.

所以,你需要(我也是:))-Wl,--enable-auto-import

有关控制警告级别的信息,请参阅官方文档

You have to send the parameter to the linker via gcc's -Wl parameter:

-Wl,option

Pass option as an option to the linker. If option contains commas,
it is split into multiple options at
the commas. You can use this syntax to
pass an argument to the option. For
example, -Wl,-Map,output.map passes
-Map output.map to the linker. When
using the GNU linker, you can also get
the same effect with
-Wl,-Map=output.map.

So, you need (and me too :)) -Wl,--enable-auto-import.

For controlling warning levels, see the official docs.

不奢求什么 2024-10-08 02:21:55

您好,到目前为止我已经找到了这个问题的部分解决方案。我还没有找到如何更改默认工具链选项,但我找到了如何在项目的基础上更改它们。

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.

alt text

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文