Q:

make: c: command not found

I am attempting to run my make file however i am getting the following two errors:
make: c: command not found
and
make: o: command not found
I am attempting to do this inside of cygwin. I have g++ and make installed on it, however when I run the make file I receive these errors.
Any ideas?
The makefile:
all: MergeSort clean

MergeSort: main.o MergeSort.o
    $g++ -o MergeSort main.o MergeSort.o

main.o: main.cpp MergeSort.h
    $g++ -c main.cpp

MergeSort.o: MergeSort.cpp MergeSort.h
    $g++ -c MergeSort.cpp

clean:
    rm -rf *o

cleanall:
    rm -rf *o *exe

A:

You need to remove the $ from the $g++ lines.  It's trying to expand some variable that doesn't exist, and is swallowing up the "$g++ -" from your commands.
The syntax for using a variable is:
$(CXX) -c main.cpp

In this case, CXX is the path to the C++ compiler, which is defined for you.  You can change it by adding the following line to your makefile:
CXX = g++

If you are trying to avoid echoing back the command make is running, use @ instead of $.

