


For example, add breakpoints and variable watch list and etc. Once the program runs, one test file is created in my Cygwin user home folder.Īs we already installed GDB, you can easily debug C/C++ program. In this sample, I am print out one string “Hello World!” and also create one test file.ġ: /* 2: = 3: Name : CProgramTest.c 4: Author : Raymond Tang 5: Version : 6: Copyright : Your copyright notice 7: Description : Hello World in C, Ansi-style 8: = 9: */ 10: 11: #include 12: #include 13: 14: int main( void) īefore you build the project, please ensure the project PATH environment includes the Cygwin paths (which includes the C standard libraries).īuild the project and then click Run button to run the program. The perspective for C/C++ project looks like the following screenshot. Remember to choose Cygwin GCC as Toolchains. You can use the Terminal to validate whether those packages are installed successfully. (I have installed these packages before and there are no details in the standard output.) The installer will resolve the dependencies automatically. In the above command line, –q means quite mode –P to specify the package we need to install. setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel –P gdb Open one Command Prompt windows (using Administrator account) and run the following command line to install the packages. Please keep the setup file (setup-x86_64.exe) when exiting the wizard.Īfter installation, you will be able to use the Terminal as you would do in Linux/Unix. You don’t need to select any package in the installation wizard as we will install the required ones later on.

Install Cygwin by following the instructions in the following link: The functionality we will mainly use includes GCC (GNU compiler) and GDB (GNU debugger). The version I installed is 4.5.2.Ĭygwin is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows. Install Eclipse IDE for C/C++ Developersīefore installing Eclipse, please install JRE first ( ).Īnd then go to Eclipse official site to download the installer.Ĭhoose Eclipse IDE for C/C++ Developers in installation wizard. I am using Windows 10 and JRE 1.8 in the following steps. Cygwin GDB will also be installed for debugging purpose. I am going to use Cygwin GCC as toolchains. In this post, I am going to demonstrate how to use Eclipse to create and debug C/C++ programs for Unix/Linux in Windows.
