Skip to content

a fix for open issue 4772#9052

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
jqly:patch-1
Jul 3, 2017
Merged

a fix for open issue 4772#9052
opencv-pushbot merged 1 commit intoopencv:masterfrom
jqly:patch-1

Conversation

@jqly
Copy link
Copy Markdown
Contributor

@jqly jqly commented Jun 30, 2017

resolves #4772

This pullrequest changes

As described in open issue #4772 (Static build error because of libstdc++ "multiple definitions"), this error still exists in current opencv 3.2.0.

When BUILD_SHARED_LIBS is turned off, -lstdc++ flag will be added to g++. In this case, libstdc++.a and libstdc++.dll.a will be all linked, as described in the issue 4772, resulting "multiple definitions" error to occur in several places.

However, the default settings of g++ compiler in TDM-GCC behaves just rightly, which links runtimes statically by default. So I think this line of code should be ommited at least in MINGW case. In my case, it works in windows 10, TDM-GCC Compiler Suite for Windows GCC 5 Series MinGW-w64 64/32-bit Edition.

As has such a fix, I successfully compiled out static libraries of opencv 3.2.0 without any error. And I have tried opencv_test_core.exe produced in the process of the whole building, passing all the tests.

@alalek
Copy link
Copy Markdown
Member

alalek commented Jul 3, 2017

👍

1 similar comment
@mshabunin
Copy link
Copy Markdown
Contributor

👍

@opencv-pushbot opencv-pushbot merged commit 4445930 into opencv:master Jul 3, 2017
opencv-pushbot pushed a commit that referenced this pull request Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants