title: Compilation Error with make file
body: <p>I've developed a C++ project using eclipse. When I launch the <code>Run</code> command from within the IDE everything will work fine and programs exits with success.
  This is the build output obtained with Eclipse's make file:</p>
  
  <pre><code>**** Build of configuration Debug for project IVPM ****
  
  make all 
  Building file: ../IVPM.cpp
  Invoking: GCC C++ Compiler
  g++ -I/usr/local/include/opencv -I/usr/include/c++/4.5.2 -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"IVPM.d" -MT"IVPM.d" -o "IVPM.o" "../IVPM.cpp"
  Finished building: ../IVPM.cpp
  
  Building file: ../TemplateMatx3.cpp
  Invoking: GCC C++ Compiler
  g++ -I/usr/local/include/opencv -I/usr/include/c++/4.5.2 -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"TemplateMatx3.d" -MT"TemplateMatx3.d" -o "TemplateMatx3.o" "../TemplateMatx3.cpp"
  Finished building: ../TemplateMatx3.cpp
  
  Building file: ../main.cpp
  Invoking: GCC C++ Compiler
  g++ -I/usr/local/include/opencv -I/usr/include/c++/4.5.2 -O0 -g3 -Wall -c -fmessage-length=0 -std=c++0x -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
  Finished building: ../main.cpp
  
  Building target: IVPM
  Invoking: GCC C++ Linker
  g++ -L/usr/local/lib -o "IVPM"  ./IVPM.o ./Matx3.o ./TemplateMatx3.o ./main.o   -lopencv_core -lpng -lopencv_highgui
  Finished building target: IVPM
  
  **** Build Finished ****
  </code></pre>
  
  <p>I was now trying to write a makefile on my own but am not able to compile with success.  Here is what I've done so far:</p>
  
  <pre><code>all:main
  
  main:IVPM.o TemplateMatx3.o
      g++ IVPM.o TemplateMatx3.o -L/usr/local/lib -lopencv_core -lpng -lopencv_highgui -o main -c main.cpp
  
  TemplateMatx3.o:TemplateMatx3.cpp
      g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -I/usr/include/c++/4.5.2 -O0 -g3 -Wall -fmessage-length=0 -std=c++0x -c TemplateMatx3.cpp
  
  IVPM.o:IVPM.cpp
      g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -I/usr/include/c++/4.5.2 -O0 -g3 -Wall -fmessage-length=0 -std=c++0x -c IVPM.cpp
  
  clean:
      rm -rf *o main 
  </code></pre>
  
  <p>But compiling on a shell with the <code>make</code> command will result in the following errors:</p>
  
  <pre><code>g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -I/usr/include/c++/4.5.2 -O0 -g3 -Wall -fmessage-length=0 -std=c++0x -c IVPM.cpp
  g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -I/usr/include/c++/4.5.2 -O0 -g3 -Wall -fmessage-length=0 -std=c++0x -c TemplateMatx3.cpp
  g++ IVPM.o TemplateMatx3.o -L/usr/local/lib -lopencv_core -lpng -lopencv_highgui -o main -c main.cpp
  In file included from /usr/include/c++/4.5/type_traits:35:0,
                   from IVPM.h:39,
                   from main.cpp:8:
  /usr/include/c++/4.5/bits/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
  In file included from main.cpp:9:0:
  IVPM.cpp: In member function ‘void IVPM&lt;Matx3DataType&gt;::loadImagesFromFileAndProcessAndSave(const std::string&amp;, const std::string&amp;, const std::string&amp;, IVPM&lt;Matx3DataType&gt;::loadImageType, IVPM&lt;Matx3DataType&gt;::saveImageFormat, IVPM&lt;Matx3DataType&gt;::imageOperationType, float, float, IVPM&lt;Matx3DataType&gt;::interpolationType)’:
  IVPM.cpp:140:39: error: no matching function for call to ‘std::basic_ifstream&lt;char&gt;::open(const std::string&amp;, const std::ios_base::openmode&amp;)’
  /usr/include/c++/4.5/fstream:526:7: note: candidate is: void std::basic_ifstream&lt;_CharT, _Traits&gt;::open(const char*, std::ios_base::openmode) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, std::ios_base::openmode = std::_Ios_Openmode]
  IVPM.cpp: In member function ‘std::vector&lt;TemplateMatx3&lt;Matx3DataType&gt;*&gt;* IVPM&lt;Matx3DataType&gt;::loadImagesFromFileAndProcessAndReturn(const std::string&amp;, const std::string&amp;, IVPM&lt;Matx3DataType&gt;::loadImageType, IVPM&lt;Matx3DataType&gt;::imageOperationType, float, float, IVPM&lt;Matx3DataType&gt;::interpolationType)’:
  IVPM.cpp:208:39: error: no matching function for call to ‘std::basic_ifstream&lt;char&gt;::open(const std::string&amp;, const std::ios_base::openmode&amp;)’
  /usr/include/c++/4.5/fstream:526:7: note: candidate is: void std::basic_ifstream&lt;_CharT, _Traits&gt;::open(const char*, std::ios_base::openmode) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, std::ios_base::openmode = std::_Ios_Openmode]
  IVPM.cpp: In member function ‘void IVPM&lt;Matx3DataType&gt;::convertMatx3VectorAndProcessAndSave(std::vector&lt;TemplateMatx3&lt;Matx3DataType&gt;*&gt;*, const std::string&amp;, IVPM&lt;Matx3DataType&gt;::saveImageFormat, IVPM&lt;Matx3DataType&gt;::imageOperationType, float, float, IVPM&lt;Matx3DataType&gt;::interpolationType)’:
  IVPM.cpp:555:58: error: there are no arguments to ‘to_string’ that depend on a template parameter, so a declaration of ‘to_string’ must be available
  IVPM.cpp:555:58: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
  IVPM.cpp: In member function ‘void IVPM&lt;Matx3DataType&gt;::loadMatx3FromFileAndProcessAndSave(const std::string&amp;, const std::string&amp;, IVPM&lt;Matx3DataType&gt;::matx3FileType, const std::string&amp;, IVPM&lt;Matx3DataType&gt;::saveImageFormat, IVPM&lt;Matx3DataType&gt;::imageOperationType, float, float, IVPM&lt;Matx3DataType&gt;::interpolationType)’:
  IVPM.cpp:704:38: error: no matching function for call to ‘std::basic_ifstream&lt;char&gt;::open(const std::string&amp;, const std::ios_base::openmode&amp;)’
  /usr/include/c++/4.5/fstream:526:7: note: candidate is: void std::basic_ifstream&lt;_CharT, _Traits&gt;::open(const char*, std::ios_base::openmode) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, std::ios_base::openmode = std::_Ios_Openmode]
  IVPM.cpp: In member function ‘std::vector&lt;TemplateMatx3&lt;Matx3DataType&gt;*&gt;* IVPM&lt;Matx3DataType&gt;::loadMatx3FromFileAndProcessAndReturn(const std::string&amp;, const std::string&amp;, IVPM&lt;Matx3DataType&gt;::matx3FileType, IVPM&lt;Matx3DataType&gt;::imageOperationType, float, float, IVPM&lt;Matx3DataType&gt;::interpolationType)’:
  IVPM.cpp:740:38: error: no matching function for call to ‘std::basic_ifstream&lt;char&gt;::open(const std::string&amp;, const std::ios_base::openmode&amp;)’
  /usr/include/c++/4.5/fstream:526:7: note: candidate is: void std::basic_ifstream&lt;_CharT, _Traits&gt;::open(const char*, std::ios_base::openmode) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, std::ios_base::openmode = std::_Ios_Openmode]
  IVPM.cpp: In member function ‘void IVPM&lt;Matx3DataType&gt;::loadVideoAndProcessAndSave(const std::string&amp;, const std::string&amp;, IVPM&lt;Matx3DataType&gt;::saveImageFormat, float, float, float, bool, IVPM&lt;Matx3DataType&gt;::imageOperationType, float, float, IVPM&lt;Matx3DataType&gt;::interpolationType) [with Matx3DataType = double, std::string = std::basic_string&lt;char&gt;]’:
  main.cpp:84:2:   instantiated from here
  IVPM.cpp:315:118: error: ‘to_string’ was not declared in this scope
  make: *** [main] Error 1
  </code></pre>
  
  <p>Apparently the compiler is not able to find matching functions of the std library. But I've included the std library in my compiling options, so why is the compiler complaining? And what is the correct procedure to follow?</p>