title: shared_ptr using gcc compiler
body: <p>I am trying to use shared_ptr in c++. I am using MinGw gcc compiler.</p>
  
  <p>My g++ version is 4.8.1. </p>
  
  <p>When I try to use std::shared_ptr, it says it does not name a type.</p>
  
  <p>Is this because it is part of c++ 11, and that is not supported in the compiled I am using?</p>
  
  <p>Or do I need to set a flag to use c++ 11 features?</p>
  
  <p>EDIT: I tried adding the flag to enable c++ to my makefile, and it still gives an error.</p>
  
  <p>My header where shared_ptr is used is as follows</p>
  
  <pre><code>#pragma once
  
  #include &lt;vector&gt;
  #include &lt;memory&gt;
  
  namespace WavFileTools
  {
      class WavFile;
  }
  
  class WavFileTools::WavFile
  {
  
      public: 
  
          typedef std::vector&lt;unsigned char&gt; PCMData8_t;
          typedef std::vector&lt;unsigned short int&gt; PCMData16_t;
  
          struct WavFileHeader {
  
              int num_channels;
              int sample_rate;
              int bits_per_sample;
          };
  
          static std::shared_ptr&lt;WavFile&gt; LoadWavFromFile(std::string filename);
  
      private:
          WavFile(void);  
  
      private:                
          WavFileHeader m_header;
          PCMData16_t m_data16;
          PCMData8_t m_data8;
  };
  </code></pre>
  
  <p>And the makefile...</p>
  
  <pre><code>CC := g++
  CFLAGS := -g -O2 -std=c++0x
  BIN_DIR := bin
  BUILD_DIR := build
  SRC_DIR := src
  MAIN := WavFileTool
  TARGET := wavfiletool.exe
  SOURCES := $(wildcard src/*.cpp)
  OBJECTS := $(SOURCES:$(SRC_DIR)/%.cpp=$(BUILD_DIR)/%.o)
  
  $(BIN_DIR)/$(TARGET): CREATE_DIRS $(BUILD_DIR)/$(MAIN).o $(OBJECTS) 
      $(CC) $(OBJECTS) $(CFLAGS)  -o $@ 
  
  $(BUILD_DIR)/$(MAIN).o: $(SRC_DIR)/WavFileTool.cpp
      $(CC) $(CFLAGS) -c -o $@ $&lt;
  
  $(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
      $(CC) $(CC_FLAGS) -c -o $@ $&lt;
  
  CREATE_DIRS: 
      if not exist $(BIN_DIR) mkdir $(BIN_DIR)
      if not exist $(BUILD_DIR) mkdir $(BUILD_DIR)
  
  CLEAN:
      if exist $(BIN_DIR) rmdir /Q /S  $(BIN_DIR) # /S allows deleting non-empty folder, and /Q prevents confirmation required
      if exist $(BUILD_DIR) rmdir /Q /S $(BUILD_DIR)
  </code></pre>
  
  <p>and the error</p>
  
  <pre><code>In file included from src/WavFile.cpp:1:0:
  src/WavFile.h:26:10: error: 'shared_ptr' in namespace 'std' does not name a type
     static std::shared_ptr&lt;WavFile&gt; LoadWavFromFile(std::string filename);
  </code></pre>