I'm only familiar with makefiles for C++ since I've had a C++ class and not C.
The program I'm doing now is most likely easiest done in C since the base code we were given is all C. I'm not too sure how to mix C and C++ so I figured just straight C is fine since I need to learn it better and I don't need C++ features (though a STL Vector would help with one task!). It's just a simple shell program to use Unix commands and signals to execute commands in a child process, so C seems like the best way to go.
I posted the makefile I used for all of my C++ programs using g++. This whole time I had been compiling this C program with the g++ makefile till I realized I should be using gcc?. It didn't occur to me right away since it compiled and worked with C++/g++ makefile. But one problem I had with the & operator (address of) might be attributed to using g++ since it maybe was interpreting it as a reference which C doesn't have AFAIK.
This same makefile I used for C++/g++ worked fine when I changed any 'g++' to 'gcc'. But the makefile examples on the internet show something quite different.
Both seem to work fine. Is there any difference I should know about and was using g++ for C code a mistake? I know -Wall is used to show warnings with gcc. But I'm not sure which one is correct or proper and I'm not too sure what all: is about. Ideas?
The program I'm doing now is most likely easiest done in C since the base code we were given is all C. I'm not too sure how to mix C and C++ so I figured just straight C is fine since I need to learn it better and I don't need C++ features (though a STL Vector would help with one task!). It's just a simple shell program to use Unix commands and signals to execute commands in a child process, so C seems like the best way to go.
I posted the makefile I used for all of my C++ programs using g++. This whole time I had been compiling this C program with the g++ makefile till I realized I should be using gcc?. It didn't occur to me right away since it compiled and worked with C++/g++ makefile. But one problem I had with the & operator (address of) might be attributed to using g++ since it maybe was interpreting it as a reference which C doesn't have AFAIK.
This same makefile I used for C++/g++ worked fine when I changed any 'g++' to 'gcc'. But the makefile examples on the internet show something quite different.
Both seem to work fine. Is there any difference I should know about and was using g++ for C code a mistake? I know -Wall is used to show warnings with gcc. But I'm not sure which one is correct or proper and I'm not too sure what all: is about. Ideas?
