I try to figure out Eclipse by writting a HelloWorld.c from scratch and hope that you can give me some help concerning the problems I face.
- When launching Eclipse, I select the standard workspace.
- In the Project Explorer, I create a new C project, called HelloWorld. Settings are "Empty Project" and "MinGW". Next: Debug and Release activated. Finish.
- In the Menu toolbar "Window->Preferences", I make sure that under "General->Workspace" the "Text File Encoding" is set to UTF-8 and "New Text File Line Delimiter" to Unix. Apply and OK. Again under "Window->Preferences->C/C++->New C/C++ Project Wizard", under "Toolchains" I select "MinGW GCC". "Make Toolchain(s) preferred", "Apply", and "OK".
Now all the necessary setings for this C project are saved in a settings file in the project folder - if I understand this right.
In the Project Explorer, ther HelloWorld Project contains now a header-folder with three subfolders (C:/MinGW64/lib/gcc/x86_64-w64-mingw32/someversion/include and .../include-fixed, and C:/MinGW64/x86_64-w64-mingw32/include).
I create a new C Source File with explicit name "HelloWorld.c" and I get a nice window with lines to write any desired code and also an outcommented "HelloWorld.c"-title on top.
So I write
#include <stdio.h>
main(){
printf("Hello World!");
return 0;
}
and save it. So far, so good. Now, I press "Build All" and get a Warning "return type defaults to 'int' [-Wreturn-type]". When I press "Debug", I get the message "Info:Nothing to build for HelloWorld" but when I press "Run", the Console shows "Hello World!" anyway.
In previous (very same) projects, I already got error messages like "Launch failed. Binary not found." which disappeard after many times pressing "Build All" and "Run". And also the error message "Program file does not exist." although I just wrote and saved the above C Source File code. I could not solve it, deleted the Project, restarted Eclipse and did all again as explained above.
What did I or am I doing wrong?