Look for data not set! You should probably have a difference between a debug and release build as well. Data will be initialized differently. Also running within an I.D.E. will move code around in memory!
Also look for a memory overwrite. Writing past the end of allocated memory. Check for unhandled errors.
Single-step your code!