Langleson
Langleson

Reputation: 103

Error building OpenCV static libraries in Windows 8 with TDM-GCC-64, Cmake, and CodeBlocks

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:

https://zahidhasan.wordpress.com/2013/02/16/how-to-install-opencv-on-windows-7-64bit-using-mingw-64-and-codeblocks/

I am essentially repeating the process, but with BUILD_SHARED_LIBS = OFF.

I build in CodeBlocks and it fails. The Build messages I get are a series of variations of the following (varying in d00xxxxxx):

C:\TDM-GCC-64\bin..\lib\gcc\x86_64-w64-mingw32\4.9.2\libstdc++.dll.a(d002386.o)|| first defined here|

The Build log shows:

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 std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::~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 ofstd::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

Both of these repeat for the maximum allowed 50 errors.

Any help would be greatly appreciated.

Upvotes: 2

Views: 619

Answers (1)

Antonio
Antonio

Reputation: 20306

It looks like a compiler/linker bug to me...

You could try the toolchain available here. (Note: this link might be soon become outdated, so in general use the link below and browse to the most recent version)

And in general at http://sourceforge.net/projects/mingw-w64/files/ where you can also find toolchains targeting 32bit architectures.

Upvotes: 0

Related Questions