1
General / Unable to build Release .exe with [-s] compiler flag
« on: July 24, 2014, 08:16:40 am »
Hello,
I am having issues with release builds of projects where the compiler flag "Strip all symbols from binary [-s]" is selected.
I have a 15 month old SFML 2.0 compiled by TDM-gcc 32bit 4.7.1-2. where the Strip all symbols flag works on release on both my laptop running codeblocks 12.11 and desktop running codeblocks 13.12. Both computers are running the same TDM-GCC vesion.
A newly compiled SFML 2.0 or SFML 2.1 result in failing to build any .exe on release with the previously mentioned flag, however with the flag removed it does produce a .exe (bigger size of course) and works.
The C++ code in question is the tutorial Graphics test because I'm simply trying to build a test file right now.
Global compiler settings:
Compiler Flags: just "Have g++ follow c++11 ISO..."
Search directories have there respective compiler and linker directories for the SFML builds in question.
Toolchain is the TDM-GCC 4.7.1-2
The project release settings can be seen in the outputs: [-s],[O2], sfml linked libraries, and I put the bin with the DLLS in the search directories -> Linker section so everything is accounted for.
I've spent 3 days just figuring out that the [-s] flag was preventing the building of the .exe. SFML 2.1 doesn't work but I'm using SFML 2.0 as a test bed to figure out why my 18 month old version works and a new one doesn't. If i can figure out why 2.0 isn't working then I should be able to get 2.1 to working afterwards.
The CMake for my current SFML 2.0 setup is keep "Build_Shared_Libs", "Release" and changed "CMake_Install_Prefix" and checkboxed SFML_Build_Examples. The examples do work with the release DLL's (the ones without the -d) so TDM-GCC and current version of SFML 2.0 build well for me.
Thanks for your time and help.
I am having issues with release builds of projects where the compiler flag "Strip all symbols from binary [-s]" is selected.
I have a 15 month old SFML 2.0 compiled by TDM-gcc 32bit 4.7.1-2. where the Strip all symbols flag works on release on both my laptop running codeblocks 12.11 and desktop running codeblocks 13.12. Both computers are running the same TDM-GCC vesion.
A newly compiled SFML 2.0 or SFML 2.1 result in failing to build any .exe on release with the previously mentioned flag, however with the flag removed it does produce a .exe (bigger size of course) and works.
The C++ code in question is the tutorial Graphics test because I'm simply trying to build a test file right now.
Build Log for functional -S flag from the 15 month old SFML 2.0
-------------- Build: Release2.0 in MadSalty (compiler: SFML 2.0 471)---------------
mingw32-g++.exe -Wall -O2 -std=c++11 -IC:\Devel\SFML2_gcc471\include -c "H:\Local Repo\MadSalty\main.cpp" -o obj\Release2\main.o
mingw32-g++.exe -LC:\Devel\SFML2_gcc471\bin -LC:\Devel\SFML2_gcc471\lib -o bin\Release2\MadSalty.exe obj\Release2\main.o -s -lsfml-graphics -lsfml-window -lsfml-system
Output file is bin\Release2\MadSalty.exe with size 80.00 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
-------------- Build: Release2.0 in MadSalty (compiler: SFML 2.0 471)---------------
mingw32-g++.exe -Wall -O2 -std=c++11 -IC:\Devel\SFML2_gcc471\include -c "H:\Local Repo\MadSalty\main.cpp" -o obj\Release2\main.o
mingw32-g++.exe -LC:\Devel\SFML2_gcc471\bin -LC:\Devel\SFML2_gcc471\lib -o bin\Release2\MadSalty.exe obj\Release2\main.o -s -lsfml-graphics -lsfml-window -lsfml-system
Output file is bin\Release2\MadSalty.exe with size 80.00 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Build Log for dysfunctional -S flag from today's compiled SFML 2.0
-------------- Build: Release2.0 compile in MadSalty (compiler: SFML 2.0 170724date)---------------
mingw32-g++.exe -Wall -O2 -std=c++11 -IC:\Devel\SFML_2.0\include -c "H:\Local Repo\MadSalty\main.cpp" -o obj\Release2c\main.o
mingw32-g++.exe -LC:\Devel\SFML_2.0\bin -LC:\Devel\SFML_2.0\lib -o bin\Release2c\MadSalty.exe obj\Release2c\main.o -s -lsfml-graphics -lsfml-window -lsfml-system
Process terminated with status 0 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))
Notice how it does not output a file. If i remove the [-s] flag it creates an output file of 669 KB. Everytime I test settings I "Rebuild" it so no old artifacts come into play.-------------- Build: Release2.0 compile in MadSalty (compiler: SFML 2.0 170724date)---------------
mingw32-g++.exe -Wall -O2 -std=c++11 -IC:\Devel\SFML_2.0\include -c "H:\Local Repo\MadSalty\main.cpp" -o obj\Release2c\main.o
mingw32-g++.exe -LC:\Devel\SFML_2.0\bin -LC:\Devel\SFML_2.0\lib -o bin\Release2c\MadSalty.exe obj\Release2c\main.o -s -lsfml-graphics -lsfml-window -lsfml-system
Process terminated with status 0 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))
Global compiler settings:
Compiler Flags: just "Have g++ follow c++11 ISO..."
Search directories have there respective compiler and linker directories for the SFML builds in question.
Toolchain is the TDM-GCC 4.7.1-2
The project release settings can be seen in the outputs: [-s],[O2], sfml linked libraries, and I put the bin with the DLLS in the search directories -> Linker section so everything is accounted for.
I've spent 3 days just figuring out that the [-s] flag was preventing the building of the .exe. SFML 2.1 doesn't work but I'm using SFML 2.0 as a test bed to figure out why my 18 month old version works and a new one doesn't. If i can figure out why 2.0 isn't working then I should be able to get 2.1 to working afterwards.
The CMake for my current SFML 2.0 setup is keep "Build_Shared_Libs", "Release" and changed "CMake_Install_Prefix" and checkboxed SFML_Build_Examples. The examples do work with the release DLL's (the ones without the -d) so TDM-GCC and current version of SFML 2.0 build well for me.
Thanks for your time and help.