Reputation: 147
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
Upvotes: 4
Views: 6081
Reputation: 1775
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/
Upvotes: 0
Reputation: 1
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.
Upvotes: 0
Reputation: 121871
It sounds like you're doing everything correctly.
TWO SUGGESTIONS:
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
Otherwise, consider deleting (or simply renaming) your current Eclipse and installing the CDT (Eclipse for C/C++ Developers) version instead:
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):
Upvotes: 2