Skip to content

Static build error because of libstdc++ "multiple definitions" #4772

@opencv-pushbot

Description

@opencv-pushbot

Transferred from http://code.opencv.org/issues/3759

|| Christoph Spanknebel on 2014-06-18 18:50
|| Priority: Low
|| Affected: 2.4.9 (latest release)
|| Category: build/install
|| Tracker: Bug
|| Difficulty: Easy
|| PR: 
|| Platform: x86 / Windows

Static build error because of libstdc++ "multiple definitions"

I tried to build OpenCV 2.4.9 static libraries with sources from Windows download and compiler TDM-GCC (MinGW32, GCC 4.8.1). In CMake configuration i just unchecked BUILD_SHARED_LIBS (from default).
While compiling the libraries only works, executing the "all" build tries to compile applications which results in errors because of multiple definitions in libstdc++.a and libstdc++.dll.a.
As background: TDM-GCC links runtimes statically by default. The compilation of OpenCV applications shows the flag "-libstdc++", which forces dynamic linking, while the linked libraries have the static runtime linked -> conflict!

History

Maksim Shabunin on 2015-04-27 09:11
-   Target version changed from 3.0-alpha to 3.0
Maksim Shabunin on 2015-04-27 14:38
-   Target version changed from 3.0 to 2.4.11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions