Freescale cup : Error message An_error_o​ccurred_du​ring_the_c​all_to_mak​e

2 vues (au cours des 30 derniers jours)
M Naveen Varma
M Naveen Varma le 25 Mar 2015
I get the following error when I build my simulink model. Why do I get this error?
### Invoking Target Language Compiler on TFC.rtw ### Using System Target File: D:\softwares\windows softwares\matlab2014\rtw\c\ert\ert.tlc ### Loading TLC function libraries ### Initial pass through model to cache user defined code ### Caching model source code ### Writing source file TFC.c ### Writing header file TFC_private.h ### Writing header file TFC.h ### Writing header file TFC_types.h ### Writing header file rtwtypes.h ### Writing source file TFC_data.c ### Writing header file rtmodel.h ### Writing source file ert_main.c ### TLC code generation complete. .### Evaluating PostCodeGenCommand specified in the model ### Using toolchain: GNU Tools for ARM Embedded Processors v4.7 | gmake (64-bit Windows) ### 'C:\Users\Naveen Varma\Documents\MATLAB\TFC_ert_rtw\TFC.mk' is up to date ### Building 'TFC': D:\SOFTWA~1\WINDOW~1\MATLAB~1\bin\win64\gmake -f TFC.mk all C:\Users\Naveen Varma\Documents\MATLAB\TFC_ert_rtw>cd .
C:\Users\Naveen Varma\Documents\MATLAB\TFC_ert_rtw>if "" == "" (D:\SOFTWA~1\WINDOW~1\MATLAB~1\bin\win64\gmake -f TFC.mk all ) else (D:\SOFTWA~1\WINDOW~1\MATLAB~1\bin\win64\gmake -f TFC.mk ) arm-none-eabi-gcc -std=c99 -MD -ffunction-sections -fdata-sections -Wall -c -O0 -mcpu=cortex-m0plus -mthumb -fno-exceptions -fno-common -fmessage-length=0 -DMODEL=TFC -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DNULL=0 -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DTARGET_KL25Z -DTARGET_M0P -DTARGET_Freescale -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M0PLUS -DARM_MATH_CM0PLUS -DRT -DSTACK_SIZE=64 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DMODEL=TFC -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/NAVEEN~1/DOCUME~1/MATLAB/TFC_ert_rtw -IC:/Users/NAVEEN~1/DOCUME~1/MATLAB -IC:/Users/NAVEEN~1/Desktop -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/extern/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/simulink/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src/ext_mode/common -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/ert -IC:/MATLAB/SupportPackages/mbed-8e73be2a2ac1 -IC:/MATLAB/SupportPackages/mbed-8e73be2a2ac1/TARGET_KL25Z -IC:/MATLAB/SupportPackages/freedomboard/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src/ext_mode/serial -o "TFC.o" "TFC.c" arm-none-eabi-gcc -std=c99 -MD -ffunction-sections -fdata-sections -Wall -c -O0 -mcpu=cortex-m0plus -mthumb -fno-exceptions -fno-common -fmessage-length=0 -DMODEL=TFC -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DNULL=0 -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DTARGET_KL25Z -DTARGET_M0P -DTARGET_Freescale -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M0PLUS -DARM_MATH_CM0PLUS -DRT -DSTACK_SIZE=64 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DMODEL=TFC -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/NAVEEN~1/DOCUME~1/MATLAB/TFC_ert_rtw -IC:/Users/NAVEEN~1/DOCUME~1/MATLAB -IC:/Users/NAVEEN~1/Desktop -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/extern/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/simulink/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src/ext_mode/common -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/ert -IC:/MATLAB/SupportPackages/mbed-8e73be2a2ac1 -IC:/MATLAB/SupportPackages/mbed-8e73be2a2ac1/TARGET_KL25Z -IC:/MATLAB/SupportPackages/freedomboard/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src/ext_mode/serial -o "TFC_data.o" "TFC_data.c" arm-none-eabi-gcc -std=c99 -MD -ffunction-sections -fdata-sections -Wall -c -O0 -mcpu=cortex-m0plus -mthumb -fno-exceptions -fno-common -fmessage-length=0 -DMODEL=TFC -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DNULL=0 -DEXIT_FAILURE=1 -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DTARGET_KL25Z -DTARGET_M0P -DTARGET_Freescale -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M0PLUS -DARM_MATH_CM0PLUS -DRT -DSTACK_SIZE=64 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=1 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DMODEL=TFC -DNUMST=2 -DNCSTATES=0 -DHAVESTDIO -IC:/Users/NAVEEN~1/DOCUME~1/MATLAB/TFC_ert_rtw -IC:/Users/NAVEEN~1/DOCUME~1/MATLAB -IC:/Users/NAVEEN~1/Desktop -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/extern/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/simulink/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src/ext_mode/common -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/ert -IC:/MATLAB/SupportPackages/mbed-8e73be2a2ac1 -IC:/MATLAB/SupportPackages/mbed-8e73be2a2ac1/TARGET_KL25Z -IC:/MATLAB/SupportPackages/freedomboard/include -ID:/SOFTWA~1/WINDOW~1/MATLAB~1/rtw/c/src/ext_mode/serial -o "ert_main.o" "ert_main.c" "### Creating standalone executable "../TFC.elf" ..." arm-none-eabi-g++ -Wl,--gc-sections -Wl,-Map="TFC.map" -mcpu=cortex-m0plus -mthumb --specs=nano.specs -T"C:\MATLAB\SupportPackages\mbed-8e73be2a2ac1/TARGET_KL25Z/TOOLCHAIN_GCC_ARM/MKL25Z4.ld" "C:\MATLAB\SupportPackages\mbed-8e73be2a2ac1/TARGET_KL25Z/TOOLCHAIN_GCC_ARM/cmsis_nvic.o" "C:\MATLAB\SupportPackages\mbed-8e73be2a2ac1/TARGET_KL25Z/TOOLCHAIN_GCC_ARM/system_MKL25Z4.o" "C:\MATLAB\SupportPackages\mbed-8e73be2a2ac1/TARGET_KL25Z/TOOLCHAIN_GCC_ARM/startup_MKL25Z4.o" "C:\MATLAB\SupportPackages\mbed-8e73be2a2ac1/TARGET_KL25Z/TOOLCHAIN_GCC_ARM/retarget.o" -lstdc++ -lsupc++ -lnosys -lc -lgcc -o ../TFC.elf battLed_wrapper.o battRead_wrapper.o MW_DC_Motor.o dcMotor_wrapper.o momSwitch_wrapper.o MW_Camera.o camera_wrapper.o MW_Servo.o servo_wrapper.o TFC.o TFC_data.o serial_wrapper.o io_wrapper.o syscalls.o BoardInit.o SysTickScheduler.o ert_main.o rt_main.o C:/MATLAB/SupportPackages/mbed-8e73be2a2ac1/TARGET_KL25Z/TOOLCHAIN_GCC_ARM/libmbed.a -lm -lm rt_main.o: In function `main': rt_main.c:(.text.main+0x0): multiple definition of `main' ert_main.o:ert_main.c:(.text.main+0x0): first defined here collect2.exe: error: ld returned 1 exit status gmake: * [../TFC.elf] Error 1
C:\Users\Naveen Varma\Documents\MATLAB\TFC_ert_rtw>echo The make command returned an error of 2 The make command returned an error of 2
C:\Users\Naveen Varma\Documents\MATLAB\TFC_ert_rtw>An_error_occurred_during_the_call_to_make 'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command, operable program or batch file.

Réponses (1)

MathWorks Student Competitions Team
It is difficult to tell what might be causing this issue from the posted output. The states error is:
multiple definition of `main'
which means that, for some reason there are two functions, either included in pre-written/compiled code or in code generated by simulink for your model, which are both named " main ".
It looks like there is a function, called " collect2 " that defines a function called " main ". It looks like Collect2 is a function used by GCC , the compiler that Simulink uses for the Freescale FRDM-KL25Z, in certain circumstances. If you are trying to add custom C/C++ code into a Simulink model you can find more information about integrating existing C/C++ code into a new Simulink Block in the Video:
If you were not intending to add any custom C/C++ code into your Simulink Model, then can you provide the following information:
  • What version of MATLAB are you using (R2014a, R2014b, R2015a)?
  • Are you on 32 or 64 bit Windows?
  • What blocks are contained in your model (you can attach your model to this question if you want)?
  • Are you having any issues compiling example models for the FRDM-KL25Z?
  • Are you using the license provided for the Freescale Cup Competition ?
  2 commentaires
M Naveen Varma
M Naveen Varma le 28 Mar 2015
Hi Thanks for all the help. I made a new model using same old blocks and everything worked perfectly.
mokhsein abdullah
mokhsein abdullah le 8 Nov 2016
Hi , how do you fix this problem ? Is it related to installation problem or something else ?

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by