Eclipse and cygwin build a revised version of the C ++ environment, eclipsecygwin
Recently, it is hard to switch the system. Cygwin is used as the C ++ environment in netbeans to continue learning. I learned a lot, so I won't be confused.
There are many such articles on the Internet. After comparison and experiment, we found a deep hole. The tutorial is similar to the others, and the highlighted part is the red letter. The appendix is as follows:
1. download cygwin. By default, Cygwin does not select the required package for C ++ development. It must be selected during installation (if there are some basic packages, do not change it so that it can be selected by default ):
Gcc, gcc-core, gcc-g ++, gcc-mingw-core, gcc-mingw-g ++, make, gdb, binutils
2. After installation, Cygwin must be added to the Windows environment variable. The environment variable path is the bin directory of cygwin.
Because gcc and g ++ cannot be executed directly from windows cmd, you can run g ++ directly in cmd and gcc to display "access denied ), go to the cygwin installation directory/bincheck whether gw.cmd.exe and gcc.exe are only 1 kb in size. If yes, the file is a symbolic link, and rename the file (Backup ). After all, replace g‑0000-3.exe(‑g‑0000-4.exe‑beibeibeibeian, and rename it g‑0000.exe. Rename gcc-3.exe‑beian as gcc.exe. Add the cygwin installation directory/bin to the environment variable PATH. Okay. Open the cmd command line window and try the gcc-v and make-v commands respectively.
3. Download Eclipse CDT plug-in address: http://www.eclipse.org/cdt/downloads.php
4. Configure path ing
During debugging in eclipse, because of the unix format path used by GDB, and eclipse uses the windows path, the matching Code cannot be found. You need to manually set it: in Eclipse in Preferences-> C/C ++-> Debug-> "Common Source Lookup Path" add new "Path Mapping ". map the linux path to the windows path: for example, MAP/cygwin/c to C:/(Interpretation 1)
5. Select the Compiler
In the C ++ project, right-click Properties> C/C ++ Build> toolchain and choose Current toolchain = Cygwin Gcc, Current builder = Gnu Make Builder,
Used tools include GCC Assembler, GCC Archiver, Cywgin C ++ Compiler, Cywgin C Compiler, Cywgin C Linker, and Cywgin C ++ Linker.
Finally, select Display compatible toolchains only. (Interpretation 2)
Explanation:
1. The ing problem is incorrect in the example. For example, when the installation path of cygwin is: D: \ configuration settings \ Cygwin \ core ing, it maps/cygwin to D: \ configuration settings \ Cygwin \ core. That is, the installation path of your cygwin. It seems that eclipse only needs the/cygwin directory. Other
2. This is not found in eclipse4.3.
Note: after creating a project, right-click it to build it. Otherwise, the project cannot run. Because my eclipse has been written into Chinese, I forgot what the English version is. You can flip the dictionary.
Problems with eclipse + cygwin c Development
Use devc ++, which is small in size. In eclipse, You need to select toolchain and create a helloworld app when using the wizard;
Is eclipse good or cygwin good? Biased towards c/c ++
Cygwin is good,
Cygwin can all write and run shell in windows, but eclipse cannot, so
Cygwin is good in this aspect. If you prefer C/C ++, I would like to say that eclipse is good because it integrates many programming environments! Are a combination of plug-ins !!!