I have no problem compiling without optimisation, but can't see a way to change the setting on the external compiler. It seems that 24*cTicksPerHour does the same thing too.
The problem seems linked to the use with a timer, although I can't see an explicit limit on the number of ms to a tick. (Just putting cTicksPerDay in a program works fine)
cTicksPerDay = 864000000000
You are trying to set the interval property of the timer to 864000000000 milliseconds which equals to 100000 days.
This number is to large (and not meaningful anyway) for the interval property.