*** ERROR L118: REFERENCE MADE TO ERRONEOUS EXTERNAL
#include<reg52.h> int i,j; bit state=0; sbit ledPin = P1^5; void main() { while(1) { ledPin = 1; for(i=0;i<1000;i++) { for(j=0;j<120;j++) { } } ledPin = 0; } }
Thx in Advance
Surely, the linker told you which External it considers to be erroneous - so why keep the rest of us guessing?
http://www.keil.com/support/man/docs/bl51/bl51_l118.htm
And, what other messages did you also get...?
And, do you really mean C251?
Besides the original question, there are two things to consider here.
1) You know that software-only delay loops are dangerous? The compiler can remove them - or greatly change they delays - when you play with optimization levels or switch compiler verison/brand?
2) Are you sure that you only want a delay while pin is high - and no delay while pin is low?
I have found the error, need to use extern key word.