Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make: g++: Command not found

I've checked similar posts and anyone solve my problem. I's very simple but I'm new with eclipse. I'm trying to make a simple example and I'm having this problem.

the make file is just this

all: hello.exe

clean:
    rm Hello.o Hello.exe

hello.exe: hello.o
    g++ -g -o hello.exe hello.o

hello.o:
    g++ -c -g main.cpp

And I get this error "make: g++: Command not found"

Thanks for helping.

like image 964
m4l490n Avatar asked Dec 14 '12 22:12

m4l490n


People also ask

What does G ++ command do in Linux?

g++ command is a GNU c++ compiler invocation command, which is used for preprocessing, compilation, assembly and linking of source code to generate an executable file.

How do you use G command?

Alternatively known as Cmd+G, Command+G is a keyboard shortcut often used to advance through results after using Find or move to a specific line in a document, spreadsheet, or text file. On Windows computers, this keyboard shortcut is performed using Ctrl + G .

Is G ++ installed by default?

GCC isn't installed by default because not everyone needs to compile a file.

What is difference between G ++ and GCC?

DIFFERENCE BETWEEN g++ & gccg++ is used to compile C++ program. gcc is used to compile C program.


1 Answers

You need to install the development tools from GNU. I assume you're on windows, in which case you have two options: cygwin and mingw. The former includes g++ out of the box. I'm less familiar with mingw, but the C++ Standard library appears to, also, be available.

See these installation instructions, I'd recommend starting from step 1, if at all possible.

like image 137
hd1 Avatar answered Sep 28 '22 01:09

hd1