GarrickW
GarrickW

Reputation: 2239

MinGW 4.7.1 doesn't recognize command line option -static-libstdc++

So I recently installed a new version of CodeBlocks with the MinGW 4.7.1 compiler, and I am no longer able to build my projects. The compiler throws the following error:

error: unrecognized command line option '-static-libstdc++'

I believe I was previously using 4.4.1 (going by the files in MinGW/bin). I installed the CobeBlocks 12.11 package that is supposed to come with the 4.7.1 compiler included.

How do I solve this? Removing that option from the compiler settings causes my previously functional application to instantly crash upon startup.

Upvotes: 0

Views: 1953

Answers (1)

Chen
Chen

Reputation: 1180

The compiler bundled with Codeblocks 12.11 is tdm-gcc 4.7.1, which by default links libstdc++ statically and reports -static-libstdc++ as an error. So if you want to dynamically link to libstdc++, add -shared-libstdc++.

Upvotes: 1

Related Questions