#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
1. Why is it so big?MinGW: large executables (http://mingw.org/wiki/Large_executables)
2. How to reduce the binary to the minimum size.There are some options listed here (http://wiki.codeblocks.org/index.php?title=Creating_a_new_project#Adding_a_new_build_target). Keep in mind that many compiler flags can have other effects (for example, static vs. dynamic runtime libraries), so read documentation to understand what they do. If something does not make sense, try Google (it does not bite).
Thanks for the link to useful information.1. Why is it so big?MinGW: large executables (http://mingw.org/wiki/Large_executables)
Did everything as written, but does not collect CodeBlocks project. What is wrong? Build log is attached (Code::Blocks v12.11).2. How to reduce the binary to the minimum size.There are some options listed here (http://wiki.codeblocks.org/index.php?title=Creating_a_new_project#Adding_a_new_build_target). Keep in mind that many compiler flags can have other effects (for example, static vs. dynamic runtime libraries), so read documentation to understand what they do. If something does not make sense, try Google (it does not bite).
-------------- Build: Release Small in First (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -o bin\ReleaseSmall\First.exe obj\ReleaseSmall\main.o -s -flto -Os -Wl,--gc-sections -shared-libgcc -shared-libstdc++
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: c:/program: error loading plugin
collect2.exe: error: ld returned 1 exit status
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: c:/program: error in plugin cleanup (ignored)
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
You can also use an external pgm in Post build steps.Thank you. But I'm more interested in the question of why is not going to my project. What's the error and how to fix it?
Google "upx"
-------------- Build: Release Small in First (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -o bin\ReleaseSmall\First.exe obj\ReleaseSmall\main.o -s -flto -Os -Wl,--gc-sections -shared-libgcc -shared-libstdc++
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: c:/program: error loading plugin
collect2.exe: error: ld returned 1 exit status
c:/program files/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: c:/program: error in plugin cleanup (ignored)
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)