I taught myself cpp sporadically from "accelerated C ++", and recently I noticed that when I forgot my #include <algorithm> statement, my code (which includes transform and find_if) compiled and ran successfully anyway. After that, I tried to completely remove all the standard include headers and found that my code was still working.
I assume that my inability to understand the preprocessor commands will be resolved by the time the book ends, but for now I just need to know how to make sure that my terminal screams at me when I make the header incorrectly, so I can learn where things are in the std library.
I am running OS 10.6.5, so I need to compile my code with the following exix exix file:
CC = g++ CFLAGS = -Wall PROG = TrainingProject23 SRCS = TrainingProject23.cpp ifeq ($(shell uname),Darwin) LIBS = -framework OpenGL -framework GLUT else LIBS = -lglut endif all: $(PROG) $(PROG): $(SRCS) $(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(LIBS) clean: rm -f $(PROG)
it includes the build protocol for OpenGL, because I learn it too, and it's easy enough to use this file to compile all of my C ++ projects. I really don't understand the Makefile, in addition to changing the src file and the program name, I just got it from the Internet.
source share