Hello, there is such a makefile:
СC= g++ CFLAGS= -c -pipe -g -Wall -W -I. LIBS= -lboost_system \ -lpthread TARGET= targ OBJECTS= main.o \ file1.o all : $(TARGET) $(TARGET): $(OBJECTS) $(CC) -o $(TARGET) $(OBJECTS) $(LIBS) main.o : main.cpp $(CC) $(CFLAGS) main.cpp file1.o : connects.cpp $(CC) $(CFLAGS) connects.cpp The main.o error crashes: an undefined reference to the symbol “_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc @@ GLIBCXX_3.4.21” /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.4/libstcdcdcdcdcdc5xc/xc/x86_64-pc-linux-gnu/5.4.4/libstcd4c4x5/4.4c command line collect2: Error: ld execution completed with return code 1 Makefile: 15: recipe execution error for targ target
however, if you manually make everything g ++ -o targ main.o file1.o -lboost_system -lpthread, then everything skips ... what could be the problem?