Linker Error in Codewarrior

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linker Error in Codewarrior

3,285 Views
yomioye2006
Contributor I

Hi ,

   I'm getting the error below when i build my project. I can't seem to find how to solve this. Can someone please tell me what I'm doing wrong? I've included all the files where the said functions are declared and referenced. I've also attached the code.

 

 

 

 

 

**** Build of configuration MCF51JM128_Internal_Flash for project mcf51jm128_demo ****

 

 

"C:\\Freescale\\CW MCU v10.6\\gnu\\bin\\mingw32-make" -j8 all

'Building target: mcf51jm128_demo.elf'

'Executing target #19 mcf51jm128_demo.elf'

'Invoking: ColdFire Linker'

"C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf" -o "mcf51jm128_demo.elf" @@"mcf51jm128_demo.args" 

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "eMBRegCoilsCB"

>Referenced from "eMBFuncWriteMultipleCoils" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "eMBRegDiscreteCB"

>Referenced from "eMBFuncReadDiscreteInputs" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "eMBRegHoldingCB"

>Referenced from "eMBFuncReadWriteMultipleHoldingRegister" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "vMBPortSerialEnable"

>Referenced from "eMBRTUSend" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "vMBPortSerialEnable"

>Referenced from "xMBRTUTransmitFSM" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "xMBPortSerialGetByte"

>Referenced from "xMBRTUReceiveFSM" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "xMBPortSerialInit"

>Referenced from "eMBRTUInit" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "xMBPortSerialPutByte"

>Referenced from "xMBRTUTransmitFSM" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Link failed.

 

 

Errors caused tool to abort.

mingw32-make: *** [mcf51jm128_demo.elf] Error 1

 

 

 

Update:

I added HCS08 to the environment and that took care of the undefined errors. Still have a few errors to contend with though. Any assistance would be appreciated. Below are the rrors I'm still dealing with. Thanks

 

 

 

 

 

**** Build of configuration MCF51JM128_Internal_Flash for project mcf51jm128_demo ****

 

 

"C:\\Freescale\\CW MCU v10.6\\gnu\\bin\\mingw32-make" -j8 all

'Building target: mcf51jm128_demo.elf'

'Executing target #18 mcf51jm128_demo.elf'

'Invoking: ColdFire Linker'

"C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf" -o "mcf51jm128_demo.elf" @@"mcf51jm128_demo.args" 

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Usage|Error

>No library file found matching 'libC:/Freescale/CW MCU v10.6/MCU/

>prog{.dylib|.a}' or 'C:/Freescale/CW MCU v10.6/MCU/prog'

mingw32-make: *** [mcf51jm128_demo.elf] Error 1

Original Attachment has been moved to: mcf51jm128_demo.zip

Labels (1)
0 Kudos
3 Replies

1,173 Views
stanish
NXP Employee
NXP Employee

Hi,

I'm missing the implementations of the prototypes that issue the link errors in your project (e.g. eMBRegCoilsCB, eMBRegDiscreteCB,...)

Where are these functions implemented? I haven't found any .c file. Is there a custom library which needs to be added into your project?

Stan

0 Kudos

1,173 Views
yomioye2006
Contributor I

Stan,

    Is this in relation to the update? I no longer have the link errors. eMBRegCoilsCB, eMBRegDiscreteCB,. I added the HC08 environment variable in the linker and that took care of these errors. The error I'm unable to solve is what I have below. I've attached my recent code. Below is the new error.



**** Build of configuration MCF51JM128_Internal_Flash for project mcf51jm128_demo ****

"C:\\Freescale\\CW MCU v10.6\\gnu\\bin\\mingw32-make" -j8 all

'Building target: mcf51jm128_demo.elf'

'Executing target #18 mcf51jm128_demo.elf'

'Invoking: ColdFire Linker'

"C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf" -o "mcf51jm128_demo.elf" @@"mcf51jm128_demo.args" 

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Usage|Error

>No library file found matching 'libC:/Freescale/CW MCU v10.6/MCU/

>prog{.dylib|.a}' or 'C:/Freescale/CW MCU v10.6/MCU/prog'

mingw32-make: *** [mcf51jm128_demo.elf] Error 1

0 Kudos

1,173 Views
stanish
NXP Employee
NXP Employee

Hi Yomi,

Yes, in fact you haven't resolved the original issue by adding the HC08 tools path as a library. By this step a new linker error  has been introduced since linker is unable to open ${HC08Tools}  = "<CW 10.x root folder>/MCU/prog". The new message is complaining it cannot open this library since it's a folder instead of a library file.

Please remove all the variables you added into Library Files dialog.

Try to localize where the missing implementations of the functions reported in your original error list are (a custom library? some .c files located outside of the project).

Perhaps these functions are not part of the FreeModbus "stack" at all, they are target dependent and needs to be implemented by your own to work well with an appropriate MCU architecture (ColdFire).

I assume eMBRegCoilsCB, eMBRegDiscreteCB, eMBRegHoldingCB are call back functions which you can probably create according to your needs.

I'd recommend to try to find this information in FreeModbus documentation.

Hope it helps.

Stanislav

0 Kudos