Menu

#152 How to use MSYS2 with Eclipse/CDT

1.0
closed
nobody
None
2017-02-05
2015-04-09
mathias
No

Hello,

Does anybody use MSYS2 and MINGW32 with eclipse / CDT?
Can somebody give me some hint how to fix it if it is possible?

I tried this https://bugs.eclipse.org/bugs/show_bug.cgi?id=442433 but i doesn´t work for me.

thx for the help

Discussion

  • Matthieu Vachon

    Matthieu Vachon - 2015-04-10

    Hi Mathias,

    I have used Eclipse CDT with msys2 and was able to mark it work correctly. The steps below are for the mingw64 toolchain, settings for an msys2 toolchain are a bit different. Also, I'm using Eclipse Luna (4.4) with latest CDT version.

    Here the rough steps I performed from memory (some could be missing, some could be extra, hope they help you):

    1. I added to my PATH the folders C:\Gnu\mingw64 and C:\Gnu\usr\bin because if I remember correctly, CDT was complaining that gcc command was not found. This is from I read, not recommended by everyone, not sure why thought.
    2. In Eclipse CDT preferences (Windows > Preferences > C/C++ > Build > Environment), set a variable MINGW_HOME to /mingw64 mount point location (in my case, path is C:\Gnu\mingw64).
    3. Restart Eclipse. Normally, that should be enough. When starting Eclipse, CDT should discover the mingw64 toolchain.

    If that does not work out of the box, there is two places to play with some settings:

    • Windows > Preferences > C/C++ > Build > Settings (Discovery Tab)
      You can try to clear entries and reset buttons on the CDT GCC Built-in Compile Settings MinGW.
    • Project Properties > C/C++ General > Preprocessor Include Paths, Macros, Etc.
      I providers tab, you can try to disable all providers except CDT GCC Built-in Compile Settings MinGW, CDT User Settings Entries and CDT Manager Build Setting Entries

    After each try, rebuild CDT index by right-clicking on project and then select Index > Rebuild.

    If it works, it should look something like this (with some differences due to settings of my own project):

    Hope this helps

    Regards,
    Matt

    P.S. Tickets are for bugs and feature requests. For support, please use the mailing list instead: https://sourceforge.net/p/msys2/mailman/msys2-users/. By using the mailing list, you will probably also reach more people as I'm pretty sure not all people monitoring the mailing list also monitors the ticketing system

     

    Last edit: Matthieu Vachon 2015-04-10
    • William Byrne

      William Byrne - 2015-10-03

      Setting MINGW_HOME to c:\msys64 worked for me. Additionally, I appended the PATH variable to c:\mys64\usr\bin which provided the msys2 binaries setup instead of the mingw64 setup. It wasn't necessary to restart eclipse v4.4.2.

       
  • David Macek

    David Macek - 2017-02-05
    • status: open --> closed
     
  • David Macek

    David Macek - 2017-02-05

    Matthieu, thanks for responding. Closing now. New issues can be filed on GitHub.