This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Linking Problem

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

Parents
  • 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?

Reply
  • 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?

Children