I have faced a peculiar problem today. My program gave linking error. It could not locate the strcpy or strncpy functions though I had included the string.h file. I then included the c51flp.lib file in my project. The error was removed and the hex file was generated. Then I removed the c51flp.lib file. This time on compiling, the errors didnot come. I am wondering why the errors didnot come again? Can anybody help! Mohit
First, header files have nothing to do with the linker; they are purely a 'C' source issue. Do you mean c51fpl.lib? That's a floating point library, so shouldn't affect strcpy or strncpy. Maybe your library search path was wrong and, as a side-effect of adding c51fpl.lib, you happened to fix it. That would explain why you could then remove c51fpl.lib and the errors not re-appear?
Are you using in-line assembly or are you using the SRC directive? AND, are you using no other C files in your project? If that's the case, see the following: http://www.keil.com/support/docs/1646.htm Jon
How and where do you specify the library search path in UV2? Mohit
Project/File Extensions, Books and Environment On the 'Environment Setup' tab, you have the choice of either 'Use settings from TOOLS.INI file' or spcific paths. Note that these settings are stored in the Project file (.uv2); however, since the Library location is usually defined by the Keil installation, I think it's better to use the TOOLS.INI file - otherwise you project may not be portable to a different Keil installation.