G ++ will not work on Lion

I searched and I got the same answer, but I think that I have different I have Xcode (4.3.2) installed on my Mac, and when I try to compile my .cpp file, it says: "command not found " Any suggestions?

How am I trying to compile;
g++ -o program code.cpp

+6
source share
3 answers

You need to install the command-line tool package through the Xcode downloads settings tab.

+12
source

open Xcode -> Preferences ... -> Download and download command line tools

0
source

I use

 make code 

and he finds the compiler, compiles code.cpp and leaves the output in the code. And he tells me the name of the compiler ... (this is g ++).

If you type "g ++", will you find the old alias?

Do you have / usr / bin in your path?

If you do this and / usr / bin / g ++ is not found, check that you have downloaded not only Xcode, but also command line utilities, which are now a separate download on the developer's page.

-3
source

Source: https://habr.com/ru/post/912348/


All Articles