When setting USEDEXTONLY for my project, I get the following error during the linking process:
*** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_INITSECSTART MODULE: START_V3.obj (?C_STARTUP) *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C_INITSECSTART MODULE: START_V3.obj (?C_STARTUP) ADDRESS: 80E6H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C_INITSECSTART MODULE: START_V3.obj (?C_STARTUP) ADDRESS: 80EAH
To overcome the problem I added C167L.LIB manually to my project. Now the linker is invoked with
C:\KEIL\C166\BIN\L166.EXE START_V3.obj, Main.obj, C:\Keil\C166\lib\C167L.LIB TO [...]
but the problem still remains. As you can see from the list of included modules from the .M66-file, the necessary parts of the library are not linked into the output file:
INPUT MODULES INCLUDED: START_V3.obj (?C_STARTUP) COMMENT TYPE 128: A166 V5.30 Main.obj (MAIN) COMMENT TYPE 128: C166 V6.10
What can I do to persuade the linker to link the required modules from C167L.LIB into the project?
See also : http://www.keil.com/support/man/docs/a166/a166_usedextonly.htm
The C_INITSECSTART external is -generated- by the linker, it's not part of the C167 lib or anything.
See startup.a66, it's referenced as:
EXTRN ?C_INITSECSTART : WORD
I'm not quite sure what the USEDEXTONLY assembler directive has to do with this; The error suggests that the external declaration is in the startup.a66 file...
What other assembler and linker directives are you using?
Perhaps the startup.a66 file tries to initialize variables using the special, linker generated, section, but your project does not have any initialized variables -> the linker does not generated the C_INITSECSTART symbol -> linker fails because startup.a66 needs it.
A solution might be to edit startup.a66 and set INIT_VARS to 0 so startup.a66 will not try to reference it. Or create a variable that needs initialization to let the linker generate the section.
-- J
Hello Joost
Thanks for your reply. The reason was indeed that there were no initialized variables in my code. Now it works.