Discussion Forum

cannot link...says "?C_START" unresolved

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Shishir Joshi
Posted
27-Jun-2005 22:16 GMT
Toolset
C51
New! 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?
Read-Only
Author
erik malund
Posted
27-Jun-2005 22:24 GMT
Toolset
C51
New! RE: cannot link...says "?C_START" unresolved
do you have a main() WITHOUT parametres?

Erik
Read-Only
Author
Shishir Joshi
Posted
27-Jun-2005 23:26 GMT
Toolset
C51
New! RE: cannot link...says "?C_START" unresolved
yes i have the main module without any parameters.
Read-Only
Author
A.W. Neil
Posted
28-Jun-2005 19:36 GMT
Toolset
C51
New! RE: cannot link...says "?C_START" unresolved
Are you using inline assembler, and/or have you enabled 'Generate Assembler SRC File'?
Read-Only
Author
Shishir Joshi
Posted
28-Jun-2005 19:44 GMT
Toolset
C51
New! RE: cannot link...says "?C_START" unresolved
Yes I have inline assembly and it never gave an error for the inline assembly I have. But "C_Start" is a call to the C start Off routine and should be found in any case. Am I right?
Read-Only
Author
Shishir Joshi
Posted
28-Jun-2005 19:46 GMT
Toolset
C51
New! RE: cannot link...says "?C_START" unresolved
I have generate assembler src enabled in the options.
Read-Only
Author
Hans-Bernhard Broeker
Posted
28-Jun-2005 22:49 GMT
Toolset
C51
New! RE: cannot link...says "?C_START" unresolved
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.
Read-Only
Author
Jon Ward
Posted
28-Jun-2005 23:26 GMT
Toolset
C51
New! RE: cannot link...says "?C_START" unresolved
The following knowledgebase article may also help.

http://www.keil.com/support/docs/1980.htm

Jon
Read-Only
Author
Shishir Joshi
Posted
28-Jun-2005 23:37 GMT
Toolset
C51
New! RE: cannot link...says "?C_START" unresolved
Great!!...Thankyou all for the help

Next Thread | Thread List | Previous Thread Start a Thread | Settings