News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

how to run compiled projects outside of codeblocks?

Started by RLFD43, August 11, 2020, 12:07:14 PM

Previous topic - Next topic

RLFD43

I made a simple text-based command prompt application project on codeblocks on windows. when I run the compiled .exe on codeblocks, it works perfectly fine. but when I run it outside of codeblocks, it gives this error: The program can't start because libstd-6.dll is missing from your computer. Try reinstalling the program to fix this problem. And even when I reinstalled the missing file, it still gave me the same error. please help.

Miguel Gimenez

You must copy that dll from the compiler folder to the executable folder.

You can also link that library (and other) statically, see Project build options -> Compiler flags -> Static libgcc and Static libstdc++

gd_on

An other solution, more general, is to add the path where this dll is located to your system path (or user path). For me, it's C:\MinGW64\bin but for you it may be something else, depending where you have installed your compiler. Codeblocks add this path in it's own path, but only for executables executed inside codeblocks : it's why your executable works inside C::B but not as a standalone executable. Adding this path to your system path solves this problem but also if your executable(s) needs some other dll in the same path (for example libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll, ...)
Nevertheless, consider that static linking is a good solution, especially if you distribute your code or want it to be executed on an other machine.
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).