Tuesday, January 26, 2010

Eclipse CDT incompatibility with Cygwin 1.7

Eclipse failed to detect the Cygwin GCC toolchain. Attempts to manually set the toolchain in project properties led to an error being displayed below the choice: "The configuration support is not installed on the system". This is because Eclipse gets Cygwin paths from the registry, and Cygwin 1.7 stopped storing them there. To fix the problem, I added the paths to the registry using a .reg file:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2]
"cygdrive prefix"="/cygdrive"
"cygdrive flags"=dword:00000022

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/]
"native"="C:\\cygwin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin]
"native"="C:\\cygwin\\bin"
"flags"=dword:0000000a

[HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib]
"native"="C:\\cygwin\\lib"
"flags"=dword:0000000a

Customize the "native" values to point to your cygwin directory.

15 comments:

  1. Anonymous2:41 am

    Exactly what I experienced.


    Thanks
    Alex

    ReplyDelete
  2. Anonymous2:45 am

    Thank you!!
    This solution fixed the problem i had with eclipse and cygwin

    ReplyDelete
  3. Anonymous5:33 am

    omg...read 4 houres several solutions, but that is it.

    A comment on eclipse and/or cygwin web page would helpful

    ReplyDelete
  4. Giles3:40 am

    Great stuff - that's saved a lot of effort. Thanks

    ReplyDelete
  5. THANKS!!! I spent two days looking for this in Eclipse's web and documentation, and found nothing!

    ReplyDelete
  6. Anonymous5:41 am

    ok, but how do you do if you have 2 eclipse+CDT with different cygwin?

    change registry each time?

    ReplyDelete
  7. Great!

    I was killing myselve why there is no cygwin toolchain in eclipse.

    Wll you rort this to eclipse/cygwin?

    Who is to blame?

    ReplyDelete
  8. Anonymous1:49 am

    I have a comp sci lab, and i think half the class is being slain by this problem. Awesome work on the solution!

    ReplyDelete
  9. Anonymous3:55 pm

    I am having the same problem but adding these values to the registry is not fixing it. My cygwin is installed to c:\tools\cygwin and I have updated the 'native' values appropriately, but still says the toolchain is incompatible. Any thoughts?

    ReplyDelete
  10. Daryl, do you have all the necessary Cygwin development tools installed? If you want to see what Eclipse checks for, you can look in the Eclipse source code.

    ReplyDelete
  11. Thank you! Seems to work. Still having a problem with my exe not being created but I think that's a different issue. Cheers.

    ReplyDelete
  12. This worked perfectly for me, thank you!!

    ReplyDelete
  13. I am sorry, its a very dumb question, can you please specify where to add the contents you mention in original post. I mean where to find the .reg file or the registry file.

    ReplyDelete
  14. You can copy the text in the post, starting with REGEDIT4 and ending with the last "flags"=dword:0000000a", and put that into a .reg file. (The lines appear wrapped in the post, but they copy properly. The stuff between square brackets is all one line.)

    You need to edit the text if cygwin isn't installed to C:\cygwin. Note how double backslashes are needed in a .reg file.

    ReplyDelete
  15. hey, could u explain me where exacly i need to change this? Coz i dont know where to find that registry file. I would rly aprichiate it.

    ReplyDelete