User forums > Help
Compiler flags -static-libgcc -static-libstdc++ don't work
Gnomoron:
Hello everyone!
I use nighty build (12072) of Code::Blocks (OS Windows 10 Home). I installed MinGW-w64 (for building 64-bit apps) and MinGW-32 (for 32-bit apps) and configured Code::Blocks for working with them. I have problems starting 32-bit applications after they are compiled. If I start the application from IDE, then the application starts normally, but if I start it manually from the explorer, it warns that the libgcc_s_dw2-1.dll is missing. I tried to turn on in the global compiler settings and project build options flags -static, -static-libgcc and -static-libstdc++, but they didn't work. Please, help me. I don't know what's wrong. Thank you in advance.
P.S.: Sorry for bad English.
Miguel Gimenez:
Post a full rebuild log, http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
Gnomoron:
--- Code: ----------------- Build: win32-d in Game (compiler: mingw-32)---------------
mingw32-g++.exe -Wall -std=c++17 -fexceptions -m32 -Og -g -m32 -Ilibraries\SFML-2.5.1\include -c D:\C++\Project\main.cpp -o obj\w32\debug\main.o
mingw32-g++.exe -Llibraries\SFML-2.5.1\lib -o bin\app32-debug.exe obj\w32\debug\main.o -static-libstdc++ -static-libgcc -m32 -lsfml-network -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system -mwindows
Output file is bin\w32\app32-debug.exe with size 1.93 MB
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))
--- End code ---
Miguel Gimenez:
Probably some of the sfml libraries use exceptions, and this can prevent the static linking of libgcc. If this is the case, just copy the dll from the MinGW folder to the folder containing your executable.
Gnomoron:
But when compiling a 64-bit application using mingw-w64 from the same sources using sfml, such an error does not occur. Perhaps I did something wrong when setting up the compiler?
Navigation
[0] Message Index
[#] Next page
Go to full version