Makefile Problems
I''m in a C++ class in college and having a little trouble with my makefile. We''re using a unix version of g++ and we have to write our own makefiles. Supposedly this is somehow easier than using MSVC++ or some crap like that. anyway - my makefile doesn''t quite work correctly. I can get it to work but it won''t work the way I need it to to get any grade at all on my project
assign6 : String.o assign6.o
g++ -Wall -o assign6 assign6.o String.o
String.o : String.h String.C
g++ -Wall -c String.h String.C
assign6.o : assign6.C String.h
g++ -Wall -c assign6.C String.h
clean :
-rm *.o assign6
there it is. When I type make at the prompt it tells me this -
g++ -Wall -c String.h String.C
g++: Compilation of header file requested
*** Error code 1
make: Fatal error: Command failed for target `String.o''
If I type "make String.o" and then make it goes without a hitch, but if it doesn''t make by only typing make I get a 0. if anyone could help that''d be great.
Use the WriteCoolGame() function
Works every time
quote:Original post by Agincourt
g++ -Wall -c String.h String.C
Remove the header file from this (and all similar) line.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement