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

cannot link...says "?C_START" unresolved

I am using c51 compiler and uv2. I wrote a small program for 89c51ed2. I included startup.a51 in the project but unable to build the project. It gives me a warning saying "unresolved external symbol C_START". I don't understand why this is happenning? Also when I change STARTUP.A51 to show xdata memory from 0000h to 06FFh, the map file generated shown "xdata end" at 0xFFFF. Is it OK?

Parents
  • But "C_Start" is a call to the C start Off routine and should be found in any case. Am I right?

    Not if you compile all your sources via assembly. But since you should never have to do that, that's easy to fix. Just remove the global "compile to SRC" and "assemble SRC file" options, or invert them for at least one .c file --- it can even be an otherwise completely empty one.

    The Keil linkers don't automatically assume that all programs are C programs. They're being given a hint in the .obj files, by the C compiler, that the C runtime environment, including the C_Start function, is needed. But this hint cannot be expressed in Keil's Ax51 assembly language. That's why translating all C files to assembly, and compiling the generated assembly, will mean the linker doesn't get this hint.

Reply
  • But "C_Start" is a call to the C start Off routine and should be found in any case. Am I right?

    Not if you compile all your sources via assembly. But since you should never have to do that, that's easy to fix. Just remove the global "compile to SRC" and "assemble SRC file" options, or invert them for at least one .c file --- it can even be an otherwise completely empty one.

    The Keil linkers don't automatically assume that all programs are C programs. They're being given a hint in the .obj files, by the C compiler, that the C runtime environment, including the C_Start function, is needed. But this hint cannot be expressed in Keil's Ax51 assembly language. That's why translating all C files to assembly, and compiling the generated assembly, will mean the linker doesn't get this hint.

Children