I am using makefile to build my code for boost cpp application. When makefile get executed it shows following message
g++ -c -Wall -I/c/MinGW/include/ -lboost_system -lws2_32 Timer_async.cpp -o Timer_async.o
and throws following error
#include <boost/asio.hpp>
^
compilation terminated.
mingw32-make: *** [makefile:15: Timer_async.o] Error 1
but if I run this makefile generated command from shell prompt
g++ -c -Wall -I/c/MinGW/include/ -lboost_system -lws2_32 Timer_async.cpp -o Timer_async.o
Program builds properly.
My make file is as
CC=g++
CFLAGS=-c -Wall
LDFLAGS=-lboost_system -lws2_32
INCLUDES=-I/c/MinGW/include/
SOURCES=Timer_async.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=hello
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(SOURCES) $(INCLUDES) $(LDFLAGS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) $< -o $@