0
votes

I'm trying to develop programs using C++ and Eclipse on MacOS X but I can't make it work. Please help me configure Eclipse! I have job interviews and I need to refresh my C++ skills!

I installed Eclipse CDT and GCC compiler for MacOS X and I try to compile a simple HelloWorld program (see code below).

#include <iostream>
using namespace std;

int main() {
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
}

I get errors and warnings and I can't seem to resolve them. Any help would be much appreciated.

  1. Errors

    • Symbol 'cout' could not be resolved (Semantic Error),
    • Same for 'endl',
    • Same for 'std'.
  2. Warnings

    • Error launching external scanner info generator (g++),
    • Error launching external scanner info generator (gcc),
    • Program 'g++' is not found in $PATH,
    • Program 'gcc' is not found in $PATH.
1
how did you install gcc? did you install Xcode?(I think you should do that) open a terminal and type g++ then enter. what happens? does it say g++ command not found or g++: no input file? - Farzam

1 Answers

0
votes

On OSX, the compiler comes as part of XCode. So, even if you don't want to use the XCode IDE, you have to install XCode to get the compiler (and linker (and other tools you need)).