Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 571655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:31:48+00:00 2026-05-13T13:31:48+00:00

I’m trying to compile the simplest program on MacOS 10.6 like: $ g++ -o

  • 0

I’m trying to compile the simplest program on MacOS 10.6 like:

$ g++ -o hello hello.cpp

the following source:

#include <iostream>

int main (int argc, char * const argv[]) {
    std::cout << "Hello, World!\n";
    return 0;
}

I’m getting the error:

hello.cpp:1:20: error: iostream: No such file or directory
hello.cpp: In function ‘int main(int, char* const*)’:
hello.cpp:4: error: ‘cout’ is not a member of ‘std’

So obviously I have to add the include path somewhere. My question is where can I find the include directories and how can add them globally (I don’t want to provide the include path whenever I want to compile).

I just installed the XCode 3.1.4 and managed to compile it via Xcode, but not via command line. I found some header files in this directory:

/Xcode3.1.4/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers

and tried to add it to the HEADER_SEARCH_PATHS after reading this question, but no luck.

I’m developing on Linux and everything is working fine there, but I want to continue doing that on MacOS. Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:31:49+00:00Added an answer on May 13, 2026 at 1:31 pm

    On my Mac, that include file is in /usr/include/c++/4.0.0/iostream . Are you sure
    you have all the command-line development tools installed? They might not be by default;
    I’m pretty sure I had to install it manually when I first set up my Mac. There should be a “developer tools” package somewhere on your OS X installation media.

    Or, if you want to make sure you’re getting the latest version, you can download it from:
    http://developer.apple.com/technology/xcode.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.