Search code examples
cdebugginggdbmingweclipse-cdt

GDB not found when MINGW-HOME in Eclipse is a relative path


When I replace the absolute path of MINGW-HOME with a Relative Path, the C code compiles and runs with a warning Toolchain "MinGW GCC" is not detected. And when i try to debug, i get the following error message. Cannot run program "gdb". I only get this problem when the path to the MINGW-HOME is written as a relative. I am also very sure that the relative path is correct because, the program can compile and run without an error, but just doesn't debug.

Here is the setting with the absolute paths:

enter image description here

Here is the setting with the relative paths and the warning:

enter image description here

Here is the error message gotten while trying to debug

enter image description here


Solution

  • Use as type Directory instead of String and start the Value with:

    • for relative to the workspace: ${workspace_loc}/../../.....
    • for relative to the project CUR: ${workspace_loc:/CUR}/../.....