I am new to C/C++ and am running make hello with the below make file. I am using Ubuntu 14.04 64-bit OS.
hello: main.o factorial.o hello.o
gcc main.o factorial.o hello.o -o hello -lstdc++
main.o: main.cpp functions.h
gcc -c main.cpp
factorial.o: factorial.cpp functions.h
gcc -c factorial.cpp
hello.o: hello.cpp functions.h
gcc -c hello.cpp
-- In the make file I do specify gcc, but the g++ is being used as below. Why is it?
-- Also, in the g++ command the -c option is missing and so the below error. How to get around this?
vm4learning@vm4learning:~/make$ make hello
g++ hello.cpp -o hello
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [hello] Error 1
makefileorMakefile? Or did you name it something else?