+ Reply to Thread
Results 1 to 5 of 5

Thread: header files not being included in c++ compiler

  1. #1
    dhruv227 is offline x10 Lieutenant dhruv227 is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    da capital
    Posts
    390

    header files not being included in c++ compiler

    hey
    i downloaded the eclipse c++ compiler and tried creating a program.
    like the usual first step, i included header files :

    #include<iostream.h>
    #include<conio.h>

    but it seems that the compiler does not recognize these header files, then i tried with this

    #include<iostream>
    #include<conio>
    using namespace std;

    it's still not compiling the program.
    what shuld i do now ?

  2. #2
    slacker3's Avatar
    slacker3 is offline x10 Sophmore slacker3 is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    145

    Re: header files not being included in c++ compiler

    you can tell the c preprocessor the full path name:

    #include "path/to/header/file.h"


    http://www.cprogramming.com/tutorial.html

  3. #3
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: header files not being included in c++ compiler

    "The eclipse C++ compiler"?
    Eclipse is only an IDE, it doesn't include a compiler. You'll have to download a compiler somewhere else. And if you're using Windows, perhaps it's a better idea to use Microsoft Visual C++ (Express Edition). The express edition is free and includes both an IDE and a compiler. (And when making Windows programs, it's easier to find support/info for that than for Eclipse.)
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  4. #4
    dhruv227 is offline x10 Lieutenant dhruv227 is an unknown quantity at this point
    Join Date
    Dec 2008
    Location
    da capital
    Posts
    390

    Re: header files not being included in c++ compiler

    thanks, MS Visual C++ is tooo large. Can you suggest me a good, decent and relatively small compiler for C and C++.

    thnx

  5. #5
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: header files not being included in c++ compiler

    Compilers are never really small (in this modern time), because of all the required files. To be able to compile a program you need the referred header files, builds of every linked executable, program libraries, ... However, you are right. MSVC++ contains a lot more than just a compiler. But note that it's considered to be very good (even by me, and I'm a Linux user) and it contains pretty much everything you need. (IDE, compiler, debugger, ...)
    There are a couple of alternatives though. The two main derivatives from gcc are MinGW and Cygwin. Both have their strengths and weaknesses, perhaps you should read the FAQ of both to get an idea.
    Another compiler I know of is the Borland compiler. I haven't got any experience with it though, nor do I know much about it.

    Also note that there are slight "dialects" in C/C++. Each compiler is a little different, for what I've heard especially Borland is good in that ; )

    But as a final piece of advice for this post I'd recommend to use either one of the gcc derivatives if you plan on using Eclipse as IDE. My experience with the actual gcc and Eclipse on Linux is that they integrate quite well.

    PS: Eclipse doesn't have C/C++ support by default, you have CDT installed, haven't you?
    Last edited by marshian; 03-09-2010 at 07:50 AM.
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

+ Reply to Thread

Similar Threads

  1. Problem Locating Header/Footer Files
    By jeeter in forum Programming Help
    Replies: 3
    Last Post: 05-09-2009, 07:51 PM
  2. Python Compiler
    By kbjradmin in forum Computers & Technology
    Replies: 3
    Last Post: 02-04-2009, 12:00 AM
  3. Free C++ compiler for Windows?
    By alcramer in forum Programming Help
    Replies: 10
    Last Post: 02-02-2009, 08:04 PM
  4. is the www to be included to the domain name?
    By allahyar in forum Feedback and Suggestions
    Replies: 1
    Last Post: 11-02-2007, 01:51 AM
  5. Javascript Compiler
    By S_W_A_T in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 08-01-2005, 06:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers