We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am using a code from a vendor. The code is for sure OK. But my linker LX51 throws errors when I try to build the project.
I have checked the "Linker control string", from which I deduce that the linker is pointing towards correct path. Then what can be the issue?
The errors are like this:
Build target 'Bootloaded Image' assembling STARTUP.A51... compiling uart.c... compiling main.c... compiling global.c... compiling timer.c... compiling F3xx_Blink_Control_F340.c... compiling F3xx_USB0_Standard_Requests.c... compiling F3xx_USB0_Descriptor.c... compiling F3xx_USB0_InterruptServiceRoutine.c... compiling F3xx_USB0_ReportHandler.c... compiling usb_commands.c... compiling usb_commands_table.c... compiling iso6b.c... compiling bitbang.c... compiling crc16.c... compiling gen2.c... compiling serialinterface.c... compiling as399x_com.c... compiling F340_FlashPrimitives.c... linking... *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: setPortNormal MODULE: .\objects\as399x_com.obj (AS399X_COM) DEFINED: .\objects\serialinterface.obj (SERIALINTERFACE) *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: setPortDirect MODULE: .\objects\as399x_com.obj (AS399X_COM) DEFINED: .\objects\serialinterface.obj (SERIALINTERFACE) *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: ?_writeReadAS399x?BYTE MODULE: .\objects\as399x_com.obj (AS399X_COM) DEFINED: .\objects\serialinterface.obj (SERIALINTERFACE) *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: _writeReadAS399x MODULE: .\objects\as399x_com.obj (AS399X_COM) DEFINED: .\objects\serialinterface.obj (SERIALINTERFACE) *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: initInterface MODULE: .\objects\as399x_com.obj (AS399X_COM) DEFINED: .\objects\serialinterface.obj (SERIALINTERFACE) *** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: _as399xInitialize MODULE: .\objects\main.obj (MAIN) *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xInitialize MODULE: .\objects\main.obj (MAIN) ADDRESS: 1004083H *** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: _as399xWaitForResponseTimed MODULE: .\objects\usb_commands.obj (USB_COMMANDS) *** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: as399xRestoreSensitivity MODULE: .\objects\usb_commands.obj (USB_COMMANDS) *** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: _as399xSingleCommand MODULE: .\objects\usb_commands.obj (USB_COMMANDS) *** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: _as399xContinuousRead MODULE: .\objects\usb_commands.obj (USB_COMMANDS) *** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: as399xSaveSensitivity MODULE: .\objects\usb_commands.obj (USB_COMMANDS) **** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xSelectLinkFrequency MODULE: .\objects\iso6b.obj (ISO6B) ADDRESS: 1006813H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: as399xEnterDirectMode MODULE: .\objects\iso6b.obj (ISO6B) ADDRESS: 10015B9H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: as399xExitDirectMode MODULE: .\objects\iso6b.obj (ISO6B) ADDRESS: 10015E5H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xSingleCommand MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 1006846H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xSingleCommand MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 100684BH *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: as399xResponse MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 10054E8H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xFifoRead MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 10054F7H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xSingleCommand MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 10054FCH *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: as399xResponse MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 10054FFH *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: as399xResponse MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 100553DH *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?_as399xContinuousWrite?BYTE MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 100315FH *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xContinuousWrite MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 1003167H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xSingleRead MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 100316CH *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xSingleWrite MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 100317BH *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?_as399xContinuousWrite?BYTE MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 1003184H *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: _as399xContinuousWrite MODULE: .\objects\gen2.obj (GEN2) ADDRESS: 100318CH Program Size: data=72.2 xdata=3654 const=1954 code=24883 Target not created
Do you have access to the source of the vendor? Do you understand the nature of the error messages? In other words, do you understand WHY the linker reports these errors?
Clearly it isn't - or you wouldn't be getting the errors!!
"what can be the issue?"
The messages tell you very clearly and explicitly what the issues are - you have lots of Multiple Public Definitions!!
The messages even tell you which files are causing the Multiple Public Definitions, and the names of the public symbols which have Multiple Definitions, !!
So you just need to search those files for those symbols, and determine which definition to keep...
NB: Having Definitions (as opposed to 'extern' declarations) in header files is a very common cause of this problem...
The most probable reason I see is the linker issue. May be the linker is not setup correctly.
The most probable reason I see is the linker issue.
The most probable reason everyone else sees is that you don't know what you're doing. The fact that you didn't even bother trying to answer any of the questions you received supports that assessment.
May be the linker is not setup correctly.
And how is anybody but you supposed to be able to inspect that setup, given you haven't provided even a single tiny detail of how you set up your linker invocation?
What makes you think that?
The most probable reason for the Linker to give "Multiple Definition" errors is, surely, because your code does, in fact, contain multiple definitions - isn't it?!
And, as I said before, the most probable rason for your code to contain multiple definitions is because of definitions in headers.
"May be the linker is not setup correctly."
Far more likely that your headers are incorrectly arranged.