I am using Silabs IDE with the Keil assembler/compiler/linker I continued to get *** FATAL ERROR L220: INVALID INPUT MODULE MODULE: C:\Accelerometer\Hope_rf\RF50_code_V04\RF50_V04\RTPHY.LIB (-----)
There are a number of references to this on the web. Anyway I removed the RTPHY.LIB file from the files to link and then got: *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?RTPHYRESTART?RTPHY
I understand that this refers to a routine that is not being used (called RTPHYRESTART here). I then commented out the routine and received no errors - My question is this: Is it safe to do this? In other words did the original problem file (RTPHY.LIB) mask out the fact that the function was not being called and is it fine to do remove the .lib file and the function code. I have searched the code files and the routine is obviously not being used (it also builds ok). So, the routine RTPHYRESTART is not being called in the code, but does the .lib file cause it to be used in some way that I don't know about? thanks and regards Russell
Maybe the function RTPHYRESTART was called by the library. But that's hard to tell without knowing it. The Fatal Error stopped the linking process far before the linker even tried to build a call tree.
There is a little difference between a working firmware and a successful build process. The only person that can really tell if removing the function/library was safe is the person that designed the software.
Hi - thanks, I will be trying the hardware out soon. I don't understand enough about libraries - how would the code in the .lib file be executed in conjunction with the main code?
A library is just a collection of functions; the "main code" just calls those functions as & when it requires.
Hi and thanks for that - Yes, that's as I thought; - so if I can build the project without that .lib file, does that sound as though the main code is obviously not using any of those functions?
Yes, it does.
I'm trying to learn a bit more about .lib files and the linking process. My understanding is that the .lib file gets linked in after compilation (is that correct?). So if the main code uses a function contained in the .lib file how does the compiler see this during compilation? Maybe you can suggest a site or reference to find out more. thanks for all the replies and patience. Russell
".lib file gets linked in after compilation (is that correct?)"
Correct.
"how does the compiler see this during compilation?"
You provide suitable external declarations - usually in a so-called "header" file.
This is standard stuff - nothing specifically to do with Keil or even 'C'.
This diagram illustrates the flow:
http://www.keil.com/c51/devproc.asp