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.

Answer from Kerrek SB on Stack Overflow
🌐
DLLme
dllme.com › dll › files › libstdc_-6
libstdc++-6.dll : Free .DLL Download
December 29, 2025 - Restoring the correct copy to the application directory or reinstalling the software typically resolves the issue. File information is supported by Human Assisted Artificial Intelligence and should be used as a helpful tool. However, it is important to keep in mind that this information may not be up-to-date or entirely accurate. Most errors involving libstdc++-6.dll occur because the DLL is missing, corrupted, or outdated...
Discussions

libstdc++-6.dll
Either your friend has to install gcc 6, or you have to compile with -static-libstdc++ On another note, do consider updating to a compiler from this decade. More on reddit.com
🌐 r/cpp_questions
24
8
October 25, 2022
mingw - how can i fix "libstdc++-6.dll not found" error in my c++ program? - Stack Overflow
recently I realized my c++ program was detected as a virus and I think it must be a compiler problem. so I uninstalled my compiler and reinstall it through msys2. the output is ok in my system but ... More on stackoverflow.com
🌐 stackoverflow.com
Windows: libstdc++-6.dll was not found
Description When I do a build of the Wails app from my local Windows computer, my teammate can run it without issue. But when they download the Wails build built from a github action, they get: "Th... More on github.com
🌐 github.com
5
June 10, 2024
Systeme fault libstdc++-6.dll missing
I want to run a C++ project but I can't open it in the console. not in the Qt editor and not the exe either. I always get the error that libstdc++-6.dll was not found. More on forum.qt.io
🌐 forum.qt.io
3
0
April 19, 2024
🌐
Fix4Dll
fix4dll.com › libstdc6_dll
libstdc++-6.dll is missing? Download it for Windows 7, 8, 10, Xp, Vista, 32 or 64 bit - Fix4Dll.com
To fix errors related with .DLL file you need to download libstdc++-6.dll and copy it to the installation folder of the application or game, or copy it into the Windows system folder and it should fix the error.
🌐
DLL-files.com
dll-files.com › libstdc++-6.dll.html
libstdc++-6.dll free download | DLL‑files.com
libstdc++-6.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vender for support.
🌐
Reddit
reddit.com › r/cpp_questions › libstdc++-6.dll
r/cpp_questions on Reddit: libstdc++-6.dll
October 25, 2022 -

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?

Top answer
1 of 6
18
Honestly, if you're beginner: drop VS Code and the MinGW compiler. You'll end up spending hours and 10 of questions here on reddit trying to set it up. Just get Visual Studio Community If you want to use VSCode + MinGW you need to know: Linux (becuase MinGW GCC is a Linux program that was ported to Windows and it relies on a lot of things done the "Linux way", so you need to understand the "Linux way". The Linux way also means reading loads of technical documentation such as the official man pages of GCC. You need to understand how a compiler and linker works and how what command line arguments to use and how to pass them You need to know how a terminal/command prompt/console works - because that is how VSCode calls the compiler under the hood You need to understand how to configure VSCode + plugins which involves modifying several .json settings files and you need to know what settings you need to set and to what You need to know about static and dynamic libraries, how they are loaded at runtime and where they should be located and why they are needed. All if this is a lot of work in "unknown territtory" for a complete beginner. Most of this is comfortably bypassed by using Visual Studio. You can in most cases just press F5 and send the generated .exe file to your friends. If you want to use MinGW and VSCode I suggest that you start by writing your first programs in Notepad and compiling them using the Command Prompt to get an idea of what is involved in building a C++ program to an .exe file. Understanding this process will greatly help you solve all kinds of problems that beginners typically run into.
2 of 6
11
Either your friend has to install gcc 6, or you have to compile with -static-libstdc++ On another note, do consider updating to a compiler from this decade.
🌐
Windows Report
windowsreport.com › windows 11 › repair › libstdc++-6.dll not found: how to fix or download it again
Libstdc++-6.dll Not Found: How to Fix or Download It Again
April 1, 2024 - Outdated software or incompatible version: If the software you are running requires a specific version of the Libstdc++-6.dll file and you have an outdated version or a conflicting version installed, it can result in the DLL not being found.
🌐
Stack Overflow
stackoverflow.com › questions › 70633262 › how-can-i-fix-libstdc-6-dll-not-found-error-in-my-c-program
mingw - how can i fix "libstdc++-6.dll not found" error in my c++ program? - Stack Overflow
Install it (e.g. for MINGW64 it's named mingw-w64-x86_64-ntldd), run ntldd -R my_program.exe, then filter out any dlls not installed by MSYS2 (for MINGW64 that would be anything outside /mingw64/bin), then copy those dlls next to the exe.
Find elsewhere
🌐
GitHub
github.com › wailsapp › wails › issues › 3532
Windows: libstdc++-6.dll was not found · Issue #3532 · wailsapp/wails
June 10, 2024 - "The code execution cannot proceed because libstdc++-6.dll was not found.
Author   wailsapp
🌐
Appuals
appuals.com › home › microsoft windows › windows dll
How to Fix Libstdc++-6.dll Not Found Error Message?
May 14, 2024 - In such cases, adding the DLL file path to the environment variable can be very helpful, as it will tell Windows about the location of the DLL file that is not being found. Click the Start Menu and type View Advanced System Settings. Hit Enter to open the Settings. Click Environment Variables and select Path from the System Variables. Then, click Edit. Now click New and paste the MinGW bin directory path. This is where the Libstdc++-6.dll is located.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360000902679-libstdc-6-dll-is-missing
libstdc++-6.dll is missing – IDEs Support (IntelliJ Platform) | JetBrains
September 25, 2018 - I added target_link_libraries(your_target_name -static) to cmakelists.txt and now I no longer get the libstdc++-6.dll is missing error when running the .exe (windows 11 console program) but the console program starts up, prompts the first prompt and then dies - process disappears from Windows task manager.
🌐
Cplusplus
cplusplus.com › forum › beginner › 102681
libstdc++-6.dll not found - C++ Forum
Somewhat relevant link: ftp://ftp.berlios.de/pub/egachine/mingwcross/README-mingw-shared-libstdc++.txt · Get ready for a sea of posts saying how "we've deprecated it". You should upgrade to Orwell Dev-C++ or Visual C++ Express to be able to use features of C++11 (the 2011 standard of C++). Bloodshed Dev-C++ limits you to C++98/03 (the 1998 standard, and its inconsequential 2003 refinement - the language itself remains the same). Anyway. In a sane world, all you'd need to do is download a MinGW runtime containing the needed DLLs.
🌐
Rust Programming Language
users.rust-lang.org › help
Where do I Get libstdc++-6.dll? - help - The Rust Programming Language Forum
February 1, 2021 - I've just cross-compiled a Rust game from Linux for Windows and I'm trying to test it, but running it with wine or in a windows development VM runs into the problem that it can't find libstdc++-6.dll, and I have no idea …
🌐
Code::Blocks
forums.codeblocks.org › index.php
Help, my EXE won't work cuz' of missing libstdc++-6.dll
October 29, 2020 - Help, my EXE won't work cuz' of missing libstdc++-6.dll
🌐
Reddit
reddit.com › r/cpp_questions › libstdc++-6.dll was not found on windows 11
r/cpp_questions on Reddit: libstdc++-6.dll was not found on windows 11
October 9, 2024 - This is because you are using GCC (from MinGW-W64). Your program uses the C++ standard library from the MinGW-W64 project which is stored in a file libstdc++-6.dll.
🌐
UMA Technology
umatechnology.org › home › how to fix libstdc++-6.dll not found error message?
How to Fix Libstdc++-6.dll Not Found Error Message? - UMA Technology
April 12, 2025 - While not always recommended due to potential security risks, downloading a fresh copy of the libstdc++-6.dll file can resolve the error.
🌐
Reddit
reddit.com › r/eclipse › "libstdc++-6.dll was not found" & "libgcc_s_dw2-1.dll was not found"
r/eclipse on Reddit: "libstdc++-6.dll was not found" & "libgcc_s_dw2-1.dll was not found"
August 9, 2021 -

Hi! I'm taking a C++ class and I've been using Eclipse on Windows 10 to write .cpp files.

Everything has been going great! Lab or Homework Problems usually are along the lines of:

"Write a program that prompts the user to enter in Weight and Height and returns their BMI"

Easy enough: I go to File > New > C/C++ Project > C++ Managed Build > I then give a project name, say "BMI Calculator" > I choose the "Hello World C++ Project" (because I was having issue when I chose "Empty Project") > I choose "MinGW GCC" for my toolchain > Finish

Then in the Project Explorer, I expand my "BMI Calculator" project > expand the "src" folder > and I find my .cpp file.

I'll edit the file, writing code that successfully completes it's job.

When I want to run the program to test it and see if it works, I'll go to File > Save All, then I'll go to Project > Build All, and then I'll go to Run > Run As > Local C/C++ Application. I can see the proper outputs in the convenient "Console" window beneath the open .cpp file I had just created, edited, and saved above. In past problems, I've read in user-entered values from the console window, displayed program outputs to this console window, the whole 9-yards. You know, like a real pro.

We got a new problem this week, write a program that determines if a year is a leap year or not. Easy enough, (a year is a leap year if it is divisible by 4 and not divisible by 100, unless it is also divisible by 400). It's not the problem I'm having trouble with, it's the fact that I need to be able to execute this program from cmd.exe, and I need to pass a value (a single year i.e. 1994, 2004, 2021, etc.) from the command line to the program!

I know, I'm sure this seems trivial, but I've been struggling with it.

I found that Eclipse makes .exe files of your .cpp files. I was able to navigate to the directory that has the .exe file that corresponds to my .cpp file in Windows File Explorer and in cmd.exe, but when I try to run the .exe file in cmd.exe (I go to the folder that has the .exe file and just type [filename].exe), I get two errors:

"The code execution cannot proceed because libstdc++-6.dll was not found. Reinstalling the program may fix this problem"

and

"The code execution cannot proceed because libgcc_s_dw2-1.dll was not found. Reinstalling the program may fix this problem"

What am I doing wrong? I have the MinGW compiler installed on my Windows machine, so I don't know what I'm doing wrong.

Additionally I have absolutely no idea how to edit my .cpp file in Eclipse to allow arguments to pass from cmd.exe, and I have absolutely no idea how to make use of passed values in the .cpp file itself. I've read a bunch of articles on it, but it still makes no sense to me.

One problem at a time, thought.

Would greatly appreciate any help.

🌐
Stack Overflow
stackoverflow.com › questions › 63817819 › libstc-6-dll-was-not-found
c++ - libstc++-6.dll was not found - Stack Overflow
Based on libstdc++-6.dll not found, it looks like the problem is that your executable isn't in the same directory as the dll, so either copy the dll file to the directory with your executable, or better: use the static options to link the libraries ...
🌐
Windows Bulletin
windowsbulletin.com › files › dll › pogo-com › travel-riddles-trip-to-india › libstdc-6-dll
What is libstdc++-6.dll? Is it Safe or a Virus? How to remove or fix it
September 20, 2019 - These messages typically suggest ... to these errors may include reinstalling the affected program, restoring the missing DLL file from a backup, or using system tools like System File Checker (SFC) to repair corrupted system files....