简体   繁体   中英

configure MinGW with Eclipse CDT

I have searched a lot about this and read most of the available answers for similar problem but I still couldn't solve it. Therefore, any help will be helpful.

I am using Eclipse Mars(Latest version after Luna) on Windows 7

MinGW is installed in "C:\\Program Files (x86)\\CodeBlocks\\MinGW\\bin".

Environment variable "Path" contains "C:\\Program Files (x86)\\CodeBlocks\\MinGW\\bin;..."
Preferences -> C/C++ -> Build -> Settings -> Discovery->CDT GCC Built-in Compiler Settings : command to get compiler specs
${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"
manually doing gcc -E -P -v -dD in cmd from any directory gives
.
.
Target: mingw32 .
.

Errors:

Program g++/gcc not found in PATH

I make a C++ project, add a file with hello world program in it.

I get errors "unresolved inclusion " and 'printf' could not be resolved.

comment if any other details required

It sounds like you're doing everything correctly.

TWO SUGGESTIONS:

  1. Take a look at this link, and see if you missed anything regarding the MinGW/GCC install:

    https://www3.ntu.edu.sg/home/ehchua/programming/howto/EclipseCpp_HowTo.html

  2. Otherwise, consider deleting (or simply renaming) your current Eclipse and installing the CDT (Eclipse for C/C++ Developers) version instead:

    http://www.eclipse.org/downloads/

  3. For whatever it's worth, here are a couple of screenshots from my property settings (I'm able to create and successfully build a new C project):

在此输入图像描述

在此输入图像描述

I think your problem is simply because of MinGW path include white spaces in it. just reinstalling MinGW on Root directory "c:\\MinGW"will solve your problem. install MinGW with basic setup packages select "mingw-developer-toolkit, mingw32-base, mingw32-gcc-g++, msys-base". complete installation. restart your pc. then check your eclipse settings. I hope your problem is already solved.

I also faced such problems,you need to set environment variable, In path add your MinGW location, if you haven't downloaded MinGW go here for downloading MinGW: http://sourceforge.net/projects/mingw/files/latest/download?source=files

Simple solution is:

在此输入图像描述

For more and detailed information to fix your problem, it worked for me!

Visit here:

http://www.multigesture.net/articles/how-to-install-mingw-msys-and-eclipse-on-windows/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM