If you are using MingW to compile C++ code on Windows, you may like to add the options -static-libgcc and -static-libstdc++ to link the C and C++ standard libraries statically and thus remove the need to carry around any separate copies of those. Version management of libraries is a pain in Windows, so I've found this approach the quickest and cleanest solution to creating Windows binaries.
Another way is if you specify -static it implies -static-libgcc and -static-libstdc++ (as well as linking to all other libraries as static where available). Note that if you are building c++ libraries (like libXX.a type files), they must also be compiled with the same static vs. not or your program will crash.
If you are using MingW to compile C++ code on Windows, you may like to add the options -static-libgcc and -static-libstdc++ to link the C and C++ standard libraries statically and thus remove the need to carry around any separate copies of those. Version management of libraries is a pain in Windows, so I've found this approach the quickest and cleanest solution to creating Windows binaries.
Another way is if you specify -static it implies -static-libgcc and -static-libstdc++ (as well as linking to all other libraries as static where available). Note that if you are building c++ libraries (like libXX.a type files), they must also be compiled with the same static vs. not or your program will crash.
As far as I know, this is the C++ Runtime Library. So it depends on the compiler you use to create your program (A new version will include some C++0x stuff, an older version will probably not for instance. It depends of the compiler and of its version).
If you use MinGW then you should use the libstdc++-6.dll found into the folder of this compiler. MinGW/bin folder should be the place to search for it on your computer.
If you copy this file in the same directory as your executable, it should be OK.
The reason this was happening to me was because I had another software installed that was also using the libstdc++-6.dll file. This software has a shorter path to the file than mine so it was getting picked up instead.
The steps I took to fix this were:
- Use search on the file explorer to find all the places where this file exists.
- Move the other files to location with a longer path name.
change from this #include <iostream> to this #include <bits/stdc++.h> this worked for me I am using VS Code with Mingw compiler and it fixed libstdc++-6.dll error.
libstdc++-6.dll not found - C++ Forum
c++ - libstc++-6.dll was not found - Stack Overflow
mingw - how can i fix "libstdc++-6.dll not found" error in my c++ program? - Stack Overflow
c++ - the code execution cannot proceed because libstdc++-6.dll was not found - Stack Overflow
I made a small programm, compiled it and sent it toy friends, who informed me of an error where libstdc++-6.dll was not found. How can i fix that?
I made a basic little DND tool set for my friend that just provides a few useful calculations.
Here’s the problem. The program runs fine on my end. But when he attempts to run it he gets the error “libstdc++-6.dll not found”
Is there a work around I can include in the program or will he simply have to install something like minGW?