User forums > Using Code::Blocks

Help, my EXE won't work cuz' of missing libstdc++-6.dll

(1/1)

CodeWolf:

Hello fellow programmers,

I may have to introduce myself as a complete beginner in C++ programming or programming in general.
Nevertheless I still got a few little programs in Codeblocks, which work perfectly in the debugger/in the Codeblocks application.

However, if I want to run them as .exe files, an error message pops up, saying "Can't run code because libstdc++-6.dll was not found."

How do I solve this problem? Is there any library I have to set up?
I wanted to take this .exe program and send it to my friends (who don't have codeblocks) to make them check it out.

Please help me get that darn exe file working.

Thank you for your help!

stahta01:
The easiest way it to copy the needed DLLs from the compiler installation likely from inside the bin folder.

The harder way is to make an static build; but, this is not always possible when using some compiler toolchains.

Tim S.

MortenMacFly:

--- Quote from: CodeWolf on October 29, 2020, 07:57:50 pm ---However, if I want to run them as .exe files, an error message pops up, saying "Can't run code because libstdc++-6.dll was not found."

--- End quote ---
You'll have to add these to the linker options:
-static-libstdc++
-static-libgcc
-static
...for static linking and this is done. I put this to the global compiler options because it annoys me a lot.

But be careful! Read the compiler's license what side-effects this may cause for your application.

Niya:
Go to "Project" menu, select "Build options...".

In the left panel, select "Release". Under the tab "Complier settings", select tab "Other complier options".

Add these below:

-static-libstdc++
-static-libgcc

Navigation

[0] Message Index

Go to full version