title: Error building OpenCV static libraries in Windows 8 with TDM-GCC-64, Cmake, and CodeBlocks
body: <p>I am trying to build static libraries with the hopes of creating a portable executable. I was successful at building dynamic libraries using the following tutorial:</p>
  
  <p><a href="https://zahidhasan.wordpress.com/2013/02/16/how-to-install-opencv-on-windows-7-64bit-using-mingw-64-and-codeblocks/" rel="nofollow">https://zahidhasan.wordpress.com/2013/02/16/how-to-install-opencv-on-windows-7-64bit-using-mingw-64-and-codeblocks/</a></p>
  
  <p>I am essentially repeating the process, but with BUILD_SHARED_LIBS = OFF.</p>
  
  <p>I build in CodeBlocks and it fails. The Build messages I get are a series of variations of the following (varying in d00xxxxxx):</p>
  
  <p>C:\TDM-GCC-64\bin..\lib\gcc\x86_64-w64-mingw32\4.9.2\libstdc++.dll.a(d002386.o)|| first defined here|</p>
  
  <p>The Build log shows:</p>
  
  <p>C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev[_ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev]+0x0): multiple definition of <code>std::basic_stringstream&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::~basic_stringstream()'
  C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/libstdc++.dll.a(d002386.o):(.text+0x0): first defined here
  C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2\libstdc++.a(sstream-inst.o):sstream-inst.cc:(.text$_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv[_ZNKSt15basic_stringbufIcSt11char_traitsIcESaIcEE3strEv]+0x0): multiple definition of</code>std::basic_stringbuf, std::allocator >::str() const'
  C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/libstdc++.dll.a(d000413.o):(.text+0x0): first defined here</p>
  
  <p>Both of these repeat for the maximum allowed 50 errors.</p>
  
  <p>Any help would be greatly appreciated.</p>