Eclipse IDE for C++ hooking up multiple compiler toolset

こ雲淡風輕ζ 提交于 2019-12-25 01:56:29

问题


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

First, a little boiler plate:

  • mingw 64bit C++ compiler (Custom compilation A)
  • mingw 64bit C++ compiler (Custom compilation B)
  • windows host

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\

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).

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

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

To keep thing simple let's make some base assumptions:

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

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


回答1:


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

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

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

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)

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)

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



来源:https://stackoverflow.com/questions/22692414/eclipse-ide-for-c-hooking-up-multiple-compiler-toolset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!