How to use a self created library and the default *.lib in Keil C ? and which and how to setup a default *.lib such as the following - c51s.lib ? c51L.lib ? c51c.lib ? ======================================= i have create a header file myfirst.h ======================================= #pragma SAVE #pragma REGPARMS extern char returndummychar(void); #pragma RESTORE ======================================== and the source code myfirst.c ======================================== char returndummychar(void) { return('a'); } ======================================== I compile the file and have myfirst.obj ======================================== lib51 create myfirst.lib lib51 add myfirst.obj to myfirst.lib ============================================ All the above steps are done. now, how to include the myfirst.lib in a new C project ?? Thank you very much !
I see a potential bug in your library function's source code. You don't #include the header file (myfirst.h) into the source code (myfirst.c). You should always do that, to enable the compiler to warn you about mismatches between the header and the implementation. Actually, I'm quite sure the definition of function myfirst() in myfirst.c is incompatible to its declaration in myfirst.h, and that's the real reason for the linker error messages you got.