用于C ++的Eclipse IDE连接了多个编译器工具集

编程入门 行业动态 更新时间:2024-10-27 03:34:15
本文介绍了用于C ++的Eclipse IDE连接了多个编译器工具集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将Eclipse IDE用于C ++开发人员,但这只是一个小问题.

I'd like to use Eclipse IDE for C++ dev but these is one little prob.

首先,准备一个小样板:

  • mingw 64位C ++编译器(自定义编译A)
  • mingw 64位C ++编译器(自定义编译B)
  • Windows主机

问题 我无法使其与多个工具链一起使用.我能找到的所有信息都表明Eclipse需要mingw dir位于C:\ mingw \

The problem I can not get it to work with multiple toolchains. All info I could find suggested that eclipse requires mingw dir to be at C:\mingw\

不适用于我的用例.首先,我有多个自定义的mingw编译器工具.我最多可以在C:\ mingw \(显然)上放一个.

that does not work for my use case. For one, I have multiple custom compiled mingw compiler tools. I can at most put one at C:\mingw\ (Obviously).

这对我意味着Eclipse不支持C ++的多个自定义工具链.

This implies to me that Eclipse does not support multiple custom toolchains for C++.

如果不是这种情况,请说明如何连接Eclipse以使用多个编译工具链.

If this is not the case, please explain how one can hook up Eclipse to use multiple compilation toolchains.

为简单起见,让我们做一些基本假设:

好吃的东西的位置: D:\ mingw_cust1 \ mingw \ D:\ mingw_cust2 \ mingw \

Location of goodies: D:\mingw_cust1\mingw\ D:\mingw_cust2\mingw\

当我在eclipse中创建一个新项目时,我希望能够选择该项目所需的工具链.

When I make a new project in eclipse I'd like to be able to choose which toolchain I want for that project.

推荐答案

问题很旧&也许很明显,但是我花了一些时间试图自己回答.

The question is old & maybe obvious but I spent time trying to answer it for myself.

在项目中切换MinGW路径的最简单方法可能是更改MINGW_HOME变量.

The easiest way to switch MinGW path in a project is probably to change the MINGW_HOME variable.

要更改它: 项目>属性> C/C ++构建>环境> MINGW_HOME字段

To change it : Project > Properties > C/C++ Build > Environment > MINGW_HOME field

更改MINGW_HOME的原点是"USER:CONFIG",而不是"BUILD SYSTEM",因此该参数是特定于项目的(甚至是特定于配置的)

Once changed the origin of MINGW_HOME is "USER: CONFIG" instead of "BUILD SYSTEM" and therefore the parameter is project-specific (or even configuration-specific)

在我的情况下,我可以设置"D:\ mingw_cust2 \ mingw \" (2)而不是继承的"D:\ mingw_cust1 \ mingw \" (1)从os'PATH'所在的(2)

In my case I could set "D:\mingw_cust2\mingw\" (2) instead of "D:\mingw_cust1\mingw\" (1) inherited from the os 'PATH' where it was above the (2)

还可以通过在窗口">首选项">"C/C ++">构建">环境"中设置MINGW_HOME变量来设置整个工作区的工具链(每个工具链都有一个工作区)

One could also set the toolchain for the whole workspace (and have a workspace per toolchain) by setting the MINGW_HOME variable in Window > Preferences > C/C++ > Build > Environment

更多推荐

用于C ++的Eclipse IDE连接了多个编译器工具集

本文发布于:2023-07-27 14:16:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1222811.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   编译器   接了   工具   Eclipse

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!