Eclipse (2018-09) CDT project with Cygwin, can't debug the binary - eclipse

It seems that everything cygwin-related configured and works fine in my Eclipse project, for example Eclipse is able to invoke 'make' or 'gcc', and can even run the compiled binary and show the output in the Eclipse console window.
However, when I try to debug my binary within Eclipse, I get the following error:
Error in final launch sequence:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
During startup program exited with code 0xc0000135.
Failed to execute MI command:
-exec-run
Error message from debugger back end:
During startup program exited with code 0xc0000135.
During startup program exited with code 0xc0000135.
I do able to launch gdb from my Cygwin console, so it is installed correctly (I assume). But why it fails when I try to use it from Eclipse?

For my case, as you say, it turns out that adding the Cygwin bin folder to the PATH variable solves this problem.
I use Eclipse 2020-06 and Cygwin 64bit on Win7 64bit. And installing Cygwin doesn't change the PATH variable currently.
But it is also confused to me that "build" and "run" work fine in Eclipse whithout the Cygwin bin in PATH.

Related

VSC Build error from the installed compilers

When i try to run task through installed compilers - mingw / clang++. it shows these error messages.
When right click and run the code it works fine.
installed the compiler through this vid
enter link description here
task.json
https://imgur.com/xNxBrM2

Cargo build broke after using VS code

For a while I have been editing my Rust program with Pycharm Professional. However, I was curious and experimented with VS Code. At first my project was compiling and running. However, it suddenly started throwing a pretty wild error on cargo build and cargo run (while cargo check is fine), even in cmd outside of VS Code:
error: linking with `link.exe` failed: exit code: 1104
= note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\rust\\book\\target\\debug\\deps\\book.1apvyby1qhuehv3.rcgu.o" "C:\\rust\\book\\target\\debug\\deps\\book.1cw7xmk0cjjg5uln.rcgu.o" "C:\\rust\\book\\target\\debug\\deps\\book.1e8ho0j4rykowhcr.rcgu.o" "C:\\rust\\book\\target\\debug\\deps\\book.1g2fbveo2gp7bxds.rcgu.o"
..............
..............
= note: LINK : fatal error LNK1104: cannot open file 'C:\rust\book\target\debug\deps\book.exe'
book is the name of my project.
I am on Windows 10, System Type: x64-based PC.
VS Code version 1.63.2
Sometimes VSCode file watcher watches the files in target/, that is not good.
So open the Settings, search for exclude, and in all "list-like" cofigurations add **/target/**, do a cargo clean and restart VSCode. This should fix this and future problems
Had to remove the directory, and redownload the whole project(used Git).

How to config CDT debug for cygwin?

I am new to eclipse CDT with cygwin. I just created a HelloWorld C++ project.
The built exe works in cygwin.
If I click the exe in file in file explorer, it says that it can not find cygwin1.dll. This error can be resolved by adding C:\cygwin64\bin to the Path env variable.
If I try to debug directly, I got the following errors:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Error creating process /cygdrive/c/WINDOWS/system32/C:/Users/Cheng_g15klso/Documents/Proj/HelloWorld/C:/Users/Cheng_g15klso/Documents/Proj/HelloWorld/Debug/HelloWorld.exe, (error 2).
The above diagnosis seems to point to lacking of C:\cygwin64\bin, so I add C:\cygwin64\bin to Path env variable in the env var tab of the debug config, but the result is the same.
My questions:
How to solve this issue?
Where to find a list of error to decode error 2?
It seems that the latest gdb above version 9.2-1 is wrong: https://www.eclipse.org/forums/index.php/t/1105969/
I have downgrade my gdb and gcc for cgywin to cure the issue

Error while trying to debug D program

My problem is that when I try to start debuggin in DDT in Eclipse (Kepler) an error shows up:
Error in final launch sequence
Failed to execute MI command:
-gdb-set auto-solib-add on
Error message from debugger back end:
No symbol table is loaded.
Use the "file" command.
No symbol table is loaded.
Use the "file" command.
I've compiled the application with -gc and -g flag but it didn't help.
I'm using original DMD compiler.
Sounds like you are working on Windows, DMD has no GDB support there yet. You can either use windbg from the command line or use the Visual Studio plugin, which converts the debug info after compiling.
The issue that I had is that the compiler (DMD) is not working with GDB under Windows. If somebody wants to use DDT with debugging support, he needs to use GDC compiler.
This actually is mentioned in the "Debugging" page:
http://wiki.dlang.org/Debugging

ndk-build.cmd: command not found

(sorry for my bad english...)
I'm trying to build my .so library in Eclipse, with the CDT plugin. (It's an android project, with native code...)
Because I'm on windows, I replaced the build command in [Project->Properties->C/C++ build] with this one:
[absolute_path_to_android-ndk]\ndk-build.cmd V=1
But I got this message in the console:
C:\SDK\android-ndk-r8\ndk-build.cmd
Cannot run program "C:\SDK\android-ndk-r8\ndk-build.cmd": Le fichier spécifié est introuvable.
Error: Program "C:/SDK/android-ndk-r8/ndk-build.cmd" is not found in PATH
I tried with only "ndk-build.cmd" in the eclipse's build command, and the path to this command in my PATH environment variable, but I still have the same error.
In fact, I can't execute any program from the eclipse's build command.
I have no problem to build the library when I call ndk-build in cmd.exe, or in cygwin, but when I try to automate the library's build in Eclipse, it doesn't work...
Does anyone have a solution to my problem?
I found the solution by adding the NDK-path to the path variable, in the ubuntu terminal as well as in eclipse. Then I had to DELETE THE ".cmd" in "ndk-build.cmd" because the terminal says that I have no permission with this file ending.