April 2, 2013

Header circular problem ("impossible" errors received)

Once I moved only one include from the main code file to the main header file, I received weird errors from IAR:

Error[Pe020]: identifier "namespace" is undefinied
Error[Pe065]: expected a ";"
and so on...

My intuition was that it is header include problems. How could it scream namespace is undefined.
I corrected few includes in my application but still no success. The same application was successfully built in KEIL. I continued with removal all unnecessary includes until I found the one which caused all errors.

Lesson learned, time to do a review of our includes in all applications.