This thread has covered a lot of ground since it started. None of the issues above are related to the compiler. I suggest you start a new thread in the CCS forum. And rather than try to address all your problems at once, I suggest you pick the one problem that is causing the most difficulty, and focus exclusively on it.
Thanks and regards,
-George