View Full Version : FYI be careful with using dead code strip on OS X

16th September 2010, 22:35
As documented here:

Mac OS X has a library called dead_strip that strips unused code to reduce executable size while compiling.

I followed the instructions in the QT documentation and included it in my libraries, and everything seemed to work fine for a while.

Then one day my code just stopped running, and would crash every time QT tried to do anything with its GUI, be it calling show() on the main window, or as simple as popping up a MessageDialog. The crash would be some variety of memory access violation or segfault.

I wasted a whole day debugging this problem basically before discovering that removing the dead code stripping made everything fine again.

Quite strange really, but if you choose to include the dead code stripping library, I'd suggest being very conscious of this lest you end up in the same situation I was.

17th September 2010, 06:26
It's strange that you need to include a library to strip the binary.
On unix systems you can just use the strip command. Or does this not work on Apple computers?