필터 지우기
필터 지우기

Error: "error: ld returned 1 exit status " during the deploy to hardware in Tiva C

조회 수: 5 (최근 30일)
Hello,
I'm learning how to use C code in the Simulink function block to be applied in my Tiva C launchpad. If i test the link in the simulation all works fine, the error appears when I try to deploy to the launchpad.
These are the codes:
Doblez.C Code:
#include <stdio.h>
#include "dobloh.h"
double u;
int main() {
return 0;
}
double doble(double u){
double car;
car=2*u;
return car;
}
dobloh.Header:
#ifndef DOBLADOR_C_
#define DOBLADOR_C_
double doble(double u);
#endif /* DOBLADOR_C_ */
Simulink blocks:
Matlab function block code:
function y = callingDoblez(u)
%#codegen
y=0.0;
y = coder.ceval('doble',u);
Error Message:
MW_EnergiaTivaHWInit.o MW_EnergiaTimerInit.o io_wrappers.o Energia_main.o arm_cortex_m_multitasking.o ert_main.o -lm
ert_main.o: In function `main':
C:\\Users\\Alberto\\Desktop\\untitled_ert_rtw/ert_main.c:39: multiple definition of `main'
doblez.o:C:\\Users\\Alberto\\Desktop\\untitled_ert_rtw/../doblez.c:7: first defined here
collect2.exe: error: ld returned 1 exit status
gmake: *** [../untitled.elf] Error 1
### Creating HTML report file untitled_codegen_rpt.html
### Build procedure for model: 'untitled' aborted due to an error.
Error(s) encountered while building "untitled":
### Failed to generate all binary outputs.
I hope you can help me to understand the error, because I can't find any solution.
Thanks
Regards Alberto

채택된 답변

Walter Roberson
Walter Roberson 2016년 4월 17일
Remove your lines that say
int main() {
return 0;
}
  댓글 수: 3

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Run on Target Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by