Find the answer to your Linux question:
Results 1 to 7 of 7
Hello All, I am new to linux. When I run the gcc compiler for my c++ program it tells me that the <iostream> file can not be found. When I ...
  1. #1
    Just Joined! brahan_7's Avatar
    Join Date
    Dec 2007
    Location
    Deep South
    Posts
    26

    Where Oh Where did the Header Files Go

    Hello All,

    I am new to linux.
    When I run the gcc compiler for my c++ program it tells me that the <iostream> file can not be found. When I run the compile command using the -v command the compiler tells me what directories it looks in for the "#include <...>" files...basically the compiler is not looking for those files in the correct directory, so gcc does not find the include files and the program doesn't compile. How can I configure gcc to look for the header files in the correct directory. (ie: the -I command only searches for #include "...")

    -brahan-

  2. #2
    Linux Newbie
    Join Date
    Jan 2008
    Location
    UK
    Posts
    211
    Hi, I just thought I would ask. What directory is gcc looking in? The standard location for iostream.h would be /usr/include/c++/4.1.2 in my case.

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Use "g++" instead. This invokes the same program that gcc does, but it is configured for C++ instead.
    DISTRO=Arch
    Registered Linux User #388732

  4. #4
    Just Joined! brahan_7's Avatar
    Join Date
    Dec 2007
    Location
    Deep South
    Posts
    26
    Quote Originally Posted by wowbag1 View Post
    Hi, I just thought I would ask. What directory is gcc looking in? The standard location for iostream.h would be /usr/include/c++/4.1.2 in my case.
    I am using cygwin and and it build to gcc files into /lib not /usr...

  5. #5
    Just Joined! brahan_7's Avatar
    Join Date
    Dec 2007
    Location
    Deep South
    Posts
    26
    using g++ compiles the program

    thanks

    -brahan

  6. #6
    Just Joined! brahan_7's Avatar
    Join Date
    Dec 2007
    Location
    Deep South
    Posts
    26
    How do i run the .exe that is outputted by the compiler?

    -brahan

  7. #7
    Just Joined!
    Join Date
    Jan 2008
    Posts
    14
    ./filename

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...