Trouble with unique_ptr : not a member of 'std'

CFLAGS is for C compilers. You are using C++ and a C++ compiler. Use CXXFLAGS in your Makefile to set C++ compiler's flags:

NAME    =   plazza

G++ =   g++

CXXFLAGS  =   -W -Wall -Wextra -Werror -std=c++11

SRC =   main.cpp

Since you are setting C flags, C++11 is not enabled because -std=c++11 is not passed to your C++ compiler. If you compiled with a C compiler, the compiler (at least GCC does it AFAIK) would warn about the C++ flag being set on the C compiler. You could use make VERBOSE=1 in these kind of compiler error situations for debugging.


Try adding

#include <memory>

To the top of your file.

Tags:

C++

C++11