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

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.

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++.

Related

g++: error unrecognized command-line option -municode using Cygwin

I am trying to build GetDP (finite-element sofware) from source using the 64-bit GNU compilers in Cygwin, namely gcc.exe, g++.exe and gfortran.exe, with their toolchain x86_64-pc-cygwin. I have the same error while linking the executable getdp.exe (in my case raised by the g++ compiler):
g++: error: unrecognized command-line option ‘-municode’
How can I solve the issue? Are there some packages that can be installed within Cygwin to enable the -municode command in the toolchain of the compilers?
I have very little experience with C/C++ programming and compilation.
Any help is really appreciated.
Strictly related to this issue.
The problem was not in Cygwin compiler toolchains, but in the CMakeList.txt file of the software I was trying to compile (GetDP).
Now the issue is fixed and the executable can be built without any errors using both gcc and mingw-x64 within Cygwin.

codeblocks 20 can't detect g++.Even though It's inside MinGW inside CodeBlocks files and added to PATH.How can I link them?

I'd been using CodeBlocks 17.02 but now I need c++14 plus support.
I tried installing codeblocks 20 which comes with latest MinGW compiler.
Problem is the IDE can't detect the compiler though it comes together, tried setting it from IDE compiler settings too. I tried adding the compiler to PATH. The compiler works fine from command line.How can I link them properly?(When latest MinGW is added to CodeBlocks 17.02, even it can't detect the compiler)
How can I use MinGW with c++17/c++14 support?
I just installed Codeblocks version 20 and then an error appears with the words "environment error can't find executable compiler". then I change the compiler settings as shown. and codeblocks can be run. my friend also experienced the same error. it could be that there is an error when installing codeblocks version 20 because it was just released.codeblocks20.03.png

Xcode gcc: dependency_info.dat No such file or directory

Hi anyone can help with dependency_info.dat No such file or directory? I'm using Xcode 7 with gcc 4.8
-dependency_info /path/my_project/build/my_project/Debug/my_project.build/Objects-normal/x86_64/my_project_dependency_info.dat
g++-4.8: error:/path/my_project/build/my_project/Debug/my_project.build/Objects-normal/x86_64/my_project_dependency_info.dat: No such file or directory
Command /usr/local/bin/g++-4.8 failed with exit code 1
what does -dependency_info flag do? How can I remove this flag?
The error went away after I deleted the path specified in Build Settings "Path to Linker Dependency Info File" for the project and the targets. So far the app is compiling and running fine without a specified path.
I had a very similar error with Xcode 7.2, OpenCV 3 and El Capitan.
In my case (and probably in yours as well), it's a linker error disguised as something else.
My project builds fine via terminal (because it already has a makefile that uses gcc), but no chance with XCode even after I configure everything in Build Settings pane according to the makefile.
This answer saved me. My OpenCV was installed using macports (it might have been precompiled binaries, or compiled on my machine, can't remember). It turns out that it's compiled with libc++ and not libstdc++.
Changing the C++ Standard Library setting accordingly in Build Settings did the trick for me.
For me it was trying to use a "/" in the app's display name that caused the build error

How to index LLVM's libc++ in Eclipse CDT?

On Ubuntu 14.04, I have llvm/clang and all the libraries installed. I am able to run the LLVM Kaleidoscope example from the command line with -std=c++11 -stdlib=libc++
I tried importing the Kaleidoscope code into Eclipse CDT. I added the /usr/include/c++/v1 path to the libc++ library. However, I'm getting the following error:
Type 'std::string' could not be resolved
How do I fix it? Am I missing some defines?
Note: I'm not trying to compile the code through CDT. I'm just trying to get the indexing to work.

Run Error With Qt Creator

I just downloaded and installed Qt Creator.
I have not messed with the PATH or any other settings.
But when I try to run a Qt GUI Application project, it gives the following error:
cc1plus.exe:-1: error: error: unrecognized command line option "-fno-keep-inline-dllexport"
The output says:
Error while building/deploying project ProjectFirst (kit: Desktop Qt
5.0.1 MinGW 32bit) When executing step 'Make'
I don't understand why this is happening. I looked it up online a lot before asking, but couldn't find anything.
I've just found the problem on my friend's computer the same as yours.
Type g++ --version to see what g++ is taking by default from your path.
If it is 4.4.* (<= 4.7.2) then found that old g++ and remove it to the trash.
Usually it goes with Perl package, needed by Qt configure.
Then return to Console and try g++ --version again
if it not 4.7.2 then lookfor old g++ again and remove it.
If it is written g++ : command not found or something like that - change your PATH variable.
Don't forget to reboot your computer after changing it.
When you got g++ --version with 4.7.2, look forward to having success.
Try to use nmake, not mingw32-make
The problem is that you are using the wrong mingw32 installation (an older version).
In order to solve this, check that the Kit you use has detected the correct Mingw version (this should be 4.7, which is located inside the qt installation tools directory).