Author Topic: Error when try to run a file inside bin/Debug in windows  (Read 1670 times)

Offline ajsbox

  • Single posting newcomer
  • *
  • Posts: 2
Error when try to run a file inside bin/Debug in windows
« on: September 02, 2022, 03:10:03 pm »
When i try to run an console application inside /bin/Debug i got an error: libstdc++6.dll
I uninstall Code::Blocks but the problem can not be solve.


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Error when try to run a file inside bin/Debug in windows
« Reply #1 on: September 02, 2022, 04:10:05 pm »
How did you install codeblocks?
In the sub folder of your installation there should be a folder called MinGW with a sub folder bin
go there and search for the libstdc++6.dll and copy it to your exe direcotry
you probably also need libgcc_s_seh-1.dll from the same folder

This is needed because your application is not statically linked and the open source compiler need some additional dlls (libstdc++6 is the standard library for c++). When you run it trough codeblocks, codeblocks adds the path MinGW/bin to the dll search paths automatically. If you run your executable by double klick this is not done, and your application can not find the dll

Offline ajsbox

  • Single posting newcomer
  • *
  • Posts: 2
Re: Error when try to run a file inside bin/Debug in windows
« Reply #2 on: September 02, 2022, 04:18:51 pm »
I went to C:\Program Files\CodeBlocks\MinGW\lib\gcc\x86_64-w64-mingw32\8.1.0 but that file is not ther " libstdc++6.dll"

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Error when try to run a file inside bin/Debug in windows
« Reply #3 on: September 02, 2022, 05:12:24 pm »
C:\Program Files\CodeBlocks\MinGW\bin
should be the folder