This is not really a question, as it is already solved. But I'd like to share it here, as someone could possibly run into the same problem. And I would love to get a more profound explanation about this.
I am using Keil μvision3 to program on a C8051F340(which I think is irrelevant to this question). In my main.c I have something like:
... // accessible code
getInput();
... // not accessible after modification
and in mobile.c(ignore headers, includes, blablabla that are irrelevant):
void getInput()
{
...
}
And it was ok. However, after I did some modification on the code,
void getInput(struct SomeStruct *ss)
{
...
}
the compilation and downloading to chip finished without any errors. Although I did find a warning:
*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: GETINPUT
But I was a bit lazy and my colleagues had a lot of other warnings that made it impossible to read.(bad habit!)
Something I would like to learn:
- Why Keil allow such a thing to compile without error(In C it should definitely be a function not declared error)?
- What does REFERENCE MADE TO UNRESOLVED EXTERNAL say? It found the function with the same name but it was unable to resolve due to it having different parameters or it simply allows any function without checking its existence in the project? I couldn't find how to generate assembly code from it so I'm not perfectly sure.