Aliã Bianco Posted August 5, 2010 Report Posted August 5, 2010 Hi guys, im using mplab to try compile my project, but wen i compile the project, i get an error. here is the cause: This explanation i found in readme of mplab c18. Referencing a variable declared 'extern' with an initializer causes an internal failure. For example: extern int x = 5; void main (void) { x++; } generates an internal error. The workaround is to remove the 'extern' storage class specification or remove the initializer. what should i do??? kill me? mysys dont work, mplab dont work... i dont have more ideas. thanks Quote
Duggle Posted August 5, 2010 Report Posted August 5, 2010 Hi guys, im using mplab to try compile my project, but wen i compile the project, i get an error. here is the cause: This explanation i found in readme of mplab c18. Referencing a variable declared 'extern' with an initializer causes an internal failure. For example: extern int x = 5; void main (void) { x++; } generates an internal error. The workaround is to remove the 'extern' storage class specification or remove the initializer. what should i do??? kill me? mysys dont work, mplab dont work... i dont have more ideas. thanks My guess is to follow the suggestion: 1) define the variable in the local module ie: int x=5; void main (void) { x++; } OR 2) initialise it in the module where it is defined ie. int x=5; AND declare it (but dont initialise it) where it is used (locally) so your code would be: extern int x ; void main (void) { x++; } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.