Solve the problem of Mark for Installation when debugging in eclipse for c/c++

       I recently wanted to learn C language, but I didn’t expect any good IDE to use it. Dev C++ is too simple, and Visual Studio is too huge. When installed on the computer, a lot of files will be installed on the C drive. At this time, I thought that eclipse has eclipse for c /c++, so I downloaded the compressed package from the official eclipse website. I thought that the eclipse interface was not too simple, and it was a decompressed version that did not need to be installed. I immediately rubbed my hands in excitement and wrote a hello world. After compiling and running, hello world appeared, perfect. ! Then I thought about the debug function that is indispensable for developing programs. I wanted to try eclipse and click debug. The problem came. A pop-up window appeared, reporting <Error with command: gdb --version Cannot run program "gdb": Launching failed>? ? ? , I searched online and found that there is no gdb package locally, so let me tell you how to install the gdb package;

       First of all, you need to install MinGW on your computer. This is usually installed when doing C language development. It is a C language compiler. If it is not installed, you can install it on Baidu. It is very simple. Then open the MinGW installation directory, enter the bin directory, and find a Double-click the mingw-get.exe file to open it, and a management interface will appear, as shown in the figure below:

Then find mingw32-gdb-bin in the list on the right, this is it

If it is not installed, the selection box is empty. Right-click the selection box and selectMark for Installation,再点击任务栏左上角的Installation-->Apply Changes,再点击apply,等待安装完成,打开cmd,输入gdb -v,如果出现下图所示的文字,说明安装完成了

Then enter eclipse and you can debug happily.

Guess you like

Origin blog.csdn.net/xuziwen127/article/details/105756544