UPX CantPackException with included .RES files lazarus / 13-General ---------------------------------------------------------------------- tech-pro · 2007-08-18 11:32 Hi. I have been away from Lazarus for a year or so, and thought I would while away a couple of hours in this awful British "summer" downloading the latest Windows release build and seeing how the project had come along. I compiled a couple of my test programs, one of which had a .RES file created using windres containing a program icon and an XP manifest file. I find that if I try to compress an executable containing this resource with UPX it fails with the error: CantPackException: writeable shared sections. I haven't changed the project since it was compiled with the last version of Lazarus I used, but I rebuilt the resource file and checked it with ResourceHacker and can't see anything wrong. Now, I'm stumped. ---------------------------------------------------------------------- antonio · 2007-08-18 11:49 I can UPX a file using WinXPTool, I don't know if this makes some difference. Otherwise,  UPX AFAIK is not recommended, it fails sometimes. ---------------------------------------------------------------------- tech-pro · 2007-08-18 12:39 I think you have provided a clue to the problem. I couldn't open the downloaded WinXPTool - Windows said the Zip file was corrupt. But I also downloaded WinXPComp from the same site. I noticed that the windres.exe in there was different from the one in my Lazarus installation:  - yours 19/12/2005 218KB  - mine 30/05/2005 103KB I replaced the one in my i386-win32 directory with yours, recompiled my program and I was then able to compress it with UPX.