Error: libstdc++ - Blogs
Back

Error: libstdc++

description : An error experience when compiling C++ on Windows using MSYS2 due to conflict with Laragon.

Date: 2025-04-24

Type: blog

Tags: ProgrammingError

# Error: `libstdc++-6.dll` Hi, I had an experience while trying to code C++ on Windows using VS Code. I was attempting to compile a "Hello World" program, but encountered an error when executing the following command: ```bash g++ -g -o hello hello.cpp ``` The error result: ```bash Starting build... cmd /c chcp 65001>nul && C:\msys64\ucrt64\bin\g++.exe -fdiagnostics-color=always -g D:\Devoloper\leetcode\hello.cpp -o D:\Devoloper\leetcode\hello.exe collect2.exe: error: ld returned 116 exit status ``` After consulting with ChatGPT, the solution turned out to be a conflict with libstdc++-6.dll from Laragon! The solution: ```bash ren C:\laragon\bin\git\mingw64\bin\libstdc++-6.dll libstdc++-6.dll.bak ``` And finally, the program compiled successfully! Why does Laragon affect this? Because Laragon includes git and mingw, which conflict with MSYS2.