-5

I am trying to study c programming. I have installed Eclipse-Neon and the latest Java JDK on my Win 7 laptop. I have tried several hours searching for this seemingly simple answer. Where are the C INCLUDE FILES? I have found the INCLUDE DIRECTORY in the JDK but the traditional header files are not there. Where is stdio.h ..etc.?

It turns out that Eclipse doesn't include a compiler. I had used Eclipse to study php in a previous life and it worked fine. Spoiler alert... Php doesn't require a compiler! C requires a compiler. Who'd a thunk it?

  • What edition of Eclipse did you install? – Andreas May 28 '17 at 14:50
  • Do you have to use Eclipse for C? There are many IDEs more suitable for C... Like Codeblocks, or Visual studio... – evandro10 May 28 '17 at 14:51
  • Welcome TO SO! Eclipse is used to develop apps in Java, so you should consider using a simple one like Dev cpp - codeblocks.. – Mohamed ALOUANE May 28 '17 at 14:52
  • 2
    @MohamedALOUANE No. Eclipse supports a variety of languages, including C and C++. – BackSlash May 28 '17 at 14:52
  • 1
    Or just use Notepad++. At least you'll learn something about compilers. – DeiDei May 28 '17 at 14:53
  • @DeiDei Why would you forego all the useful features of an IDE, such as code completion, debugging, following methods and classes to their source, build management, etc? – Andreas May 28 '17 at 14:55
  • eclipse needs jre to run but it shouldn't need jdk to develop c++/c, the jdk is for java development(although it may still require it), anyway the headers you mentioned like `stdio` and etc comes with the c/c++ compiler you're using whichever it is – niceman May 28 '17 at 14:57
  • @DeiDei Yeah, but for a beginner using Eclipse is not recommended ! – Mohamed ALOUANE May 28 '17 at 14:57
  • 1
    @Andreas IMO you should always do things by hand before using automated tools. This way you'll learn the basics, once you know the basics you can move to automated tools. That's what teachers usually do (at least here): if you attend a java class, first you use notepad and compile with `javac`, and once you are familiar with `javac` you switch to an IDE. Different approaches though, none of the two is wrong IMO. – BackSlash May 28 '17 at 14:58
  • the c/c++ compiler is perhaps visual c++ ? or maybe mingw ? (I mentioned these as you are a windows developer) – niceman May 28 '17 at 14:59
  • as a linux user I use either of gcc or clang, I'm not sure if they can be installed on windows but I prefer them because they almost always support latest standard versions(e.g. c++17, C11, Openmp 4.5, etc) – niceman May 28 '17 at 15:00
  • I agree with @MohamedALOUANE , for a beginner IDEs like codeblocks or others would be better – niceman May 28 '17 at 15:03

1 Answers1

3

The C header files come with the C compiler, not with "Eclipse IDE for C/C++ Developers".

You need to following the installation instructions, which will tell you to install a C compiler. If you can't find installation instructions, try a web search for How to install and run Eclipse IDE for C/C++ Developers.

But the best would probably be the Eclipse Help page, "Before you begin", in the "C/C++ Development User Guide", which says:

[...], if you downloaded the CDT from the Eclipse web site, then you will require a toolchain before you can build and debug any projects.

The standard CDT supports integration with the GNU toolchain. [...]

[...]

For windows, MinGW and Cygwin are the two main platform choices for acquiring the GNU toolchain. [...]

  • For MinGW, it is recommended to use the MinGW installer, mingw-get, to manage your MinGW installation. Download and run the lateset mingw-get-inst package from the MinGW Downloads page. The CDT MinGW toolchain will find this install if it is located in the default C:\MinGW directory, the MinGW bin directory is placed in your path, or if the MinGW location is stored in the MINGW_HOME environment variable.
    Note that the Wascana IDE has been discontinued.

  • Cygwin can be installed from the Cygwin site at http://www.cygwin.com. You need to manually select the gcc, gdb, and make packages to install the toolchain.

[...]

Community
  • 1
  • 1
Andreas
  • 154,647
  • 11
  • 152
  • 247
  • I encountered the same problem and was missing the C header files as you point out. I had done a similar web search as you suggested, and there is a lot of advice out there, but most of it did not work for me. Can you recommend a specific site that you know solves this? I realize that there may be many reasons for why an Eclipse C IDE may be broken, but it would be nice to have a site that lists all the setup steps starting with downloading a vanilla Eclipse such as Neon. Thanks! My question sadly remains unsolved: https://stackoverflow.com/q/42629820/6693299 – ScottK May 28 '17 at 15:23
  • Check this Youtube video: Eclipse IDE for C/C++ Developers - Download, Install, and Run | eitlearning.com – Patrick J Burns May 28 '17 at 19:06