When I 74compile my project I get these errors: **************************************** *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_STARTUP MODULE: gf.obj (GF) *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C?COPY MODULE: gf.obj (GF) *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C?COPY MODULE: gf.obj (GF) ADDRESS: 0027H ******** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_STARTUP MODULE: gf.obj (GF) *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C?COPY MODULE: gf.obj (GF) *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C?COPY MODULE: gf.obj (GF) ADDRESS: 0027H ******************************************* What does this mean and where is the problem? Thanks
It means that for some reasons the startup files and C runtime library weren't pulled into the link of your program. It's a little hard to guess why that would happen, mainly because you didn't supply any of the crucial information. A look at the very first couple of lines of the .map file (which I hope you're having generated), or any other way that gives you the actual linker command line used, would help.
"It means that for some reasons the startup files and C runtime library weren't pulled into the link of your program." Yep, that's it "It's a little hard to guess why that would happen" Actually, it's not: the reason is that he's converting all his 'C' source into assembler source, then using the assembler to generate the object files. Therefore, all the Linker sees is assembler-generated object files - so it has no reason to include any 'C' runtime! The answer is either to include the 'C' runtime manually, or just to ensure that there is at least one 'C' source file that is actually translated direct to object by the C51 compiler. I'm sure there's a knowledgebase article on this. This does, of course, beg the question of WHY he is converting everything via assembler?! I always recommend that any bits of the project that need to be written in assembler should be written as proper assembler modules and called from 'C' - rather than messing about with inline assembler. There's a whole section in the Manual on how to do that.
The problem is that I am using startup.a51 and init.a51, so I think in this case I should translate all c files to src. If I shouldn't, then how can this be done Thanks for help
Your question has been answered several times in this thread. Please read the manual on converting 'C' to asm. In your case I think you should leave everythin in 'C' and don't touch startup and init until you can compile and assemble you programs. DO NOT convert your 'C' files to ASM unless you need to do some serious optomizing.Reading this thread I feel the compiler can build much better code than you. Remember the toolset knows the difference between .a* files and c. files. Uv2 will call the correct translator and the linker can care less if the object was created from the compiler or the assemble. Brad
"DO NOT convert your 'C' files to ASM unless you need to do some serious optomizing." (my emphasis) Even then, there is no need to convert your 'C' source files to assembler sources files: Just get the compiler to include the generated assembler in its Listing file. Then, if you do find parts that need hand optimising, write them properly in assembler as assembler modules and call them from 'C' - do NOT mess about with inline assembler!
View all questions in Keil forum