Consider this Makefile
% cat Makefile
main: main.o add.o
which uses cc
instead of g++
to link the object files
% make
g++ -Wall -pedantic -std=c++0x -c -o main.o main.cpp
g++ -Wall -pedantic -std=c++0x -c -o add.o add.cpp
cc main.o add.o -o main
main.o:main.cpp:(.text+0x40): undefined reference to `std::cout'
...
How do I tell (GNU) Make to use g++
(which links the C++ libraries) instead of cc
?