i recently started a small project in C++. I created a simply Makefile:
CC=g++
CFLAGS =-std=c++0x -I. -c
VPATH = src include
vpath %.c src
vpath %.h include
TabooSearch : main.o Task.o TabooList.o
$(CC) $(CFLAGS) -o TabooSearch main.o Task.o TabooList.o
The problem is that when i run make i get this kind of errors form gcc:
error: ‘nullptr’ was not declared in this scope
I don’t have any ides what is wrong with my Makefile, can someone help me solve this problem. My gcc version is 4.7.2 on Debian
Thanks in advance
Since you are using implicit rules for building the
.ofiles, you should useCXXFLAGSto set the C++ flags:No need for
-I.or-c.I would add a few more flags to get decent errors and warnings:
Likewise for
g++. If your default settings do not invoke g++, then you need to add