2016-08-25 3 views
0

내가 소서리 CodeBench IDE하는 STM32F10X 프로그래밍에서 C 작업, 나는이 코드를 컴파일 할 때 나는 그것을 실행하면빌드 실패 C STM32F10X

int main(void){ 

RCC_Configuration(); 

/* NVIC configuration */ 
NVIC_Configuration(); 

/* GPIO configuration */ 
GPIO_Configuration(); 

SysTick_Configuration(); 

Timer_Configuration(); 

dxl_initialize(0, 1); 
USART_Configuration(USART_PC, Baudrate_PC); 

GoalPos1[0]= 333; 
GoalPos1[1]= 333; 
GoalPos2[0]=690; 
GoalPos2[1]=690; 
GoalPos5[0]=412; 
GoalPos5[1]=412; 
GoalPos6[0]=611; 
GoalPos6[1]=611; 
GoalPos7[0]=355; 
GoalPos7[1]=355; 
GoalPos8[0]=664; 
GoalPos8[1]=664; 
double t = 1.0; 

while(1) 
{ 
    bMoving = dxl_read_byte(id, P_MOVING); 
    CommStatus = dxl_get_result(); 
    if(CommStatus == COMM_RXSUCCESS) 
    { 
     if(bMoving == 0) 
     { 
      if(t<=2){GoalPos3[0]=(int)(-1.5*t+300.7);GoalPos3[1]=(int)(-1.5*t+300.7);}else{GoalPos3[0]=298;GoalPos3[1]=298;}if(t<=2){GoalPos4[0]=(int)(1.5*t+721.0);GoalPos4[1]=(int)(1.5*t+721.0);}else{GoalPos4[0]=724;GoalPos4[1]=724;}GoalPos9[0]=(int)(0.0001661*t*t*t*t*t*t+0.0006153*t*t*t*t*t-0.1318*t*t*t*t+1.254*t*t*t+2.925*t*t-43.64*t+527.9);GoalPos9[1]=GoalPos9[0];GoalPos10[0]=(int)(0.0003296*t*t*t*t*t*t-0.01189*t*t*t*t*t+0.2032*t*t*t*t-2.895*t*t*t+27.86*t*t-109.9*t+613.8);GoalPos10[1]=GoalPos10[0];GoalPos11[0]=(int)(-0.006659*t*t*t*t*t*t+0.2862*t*t*t*t*t-4.584*t*t*t*t+33.35*t*t*t-105.1*t*t+102.1*t+379.3);GoalPos11[1]=GoalPos11[0];GoalPos12[0]=(int)(0.000823*t*t*t*t*t*t-0.01887*t*t*t*t*t-0.09102*t*t*t*t+5.247*t*t*t-44.36*t*t+130.7*t+528.9);GoalPos12[1]=GoalPos12[0];GoalPos13[0]=(int)(-0.003788*t*t*t*t*t*t+0.1389*t*t*t*t*t-1.64*t*t*t*t+5.74*t*t*t+7.459*t*t-24.55*t+297.2);GoalPos13[1]=GoalPos13[0];GoalPos14[0]=(int)(0.002975*t*t*t*t*t*t-0.1283*t*t*t*t*t+2.114*t*t*t*t-16.1*t*t*t+50.88*t*t-38.08*t+744.6);GoalPos14[1]=GoalPos14[0];GoalPos15[0]=(int)(-0.007288*t*t*t*t*t*t+0.3476*t*t*t*t*t-6.384*t*t*t*t+55.4*t*t*t-219.1*t*t+301.6*t+492.8);GoalPos15[1]=GoalPos15[0];GoalPos16[0]=(int)(0.001997*t*t*t*t*t*t-0.07483*t*t*t*t*t+0.881*t*t*t*t-2.857*t*t*t-5.658*t*t+27.76*t+378.4);GoalPos16[1]=GoalPos16[0];GoalPos17[0]=(int)(-0.0002364 *t*t*t*t*t*t+0.02187*t*t*t*t*t-0.5432 *t*t*t*t+4.617*t*t*t-6.029*t*t-49.48*t+537.6);GoalPos17[1]=GoalPos17[0];GoalPos18[0]=(int)(0.000729*t*t*t*t*t*t-0.03161*t*t*t*t*t+0.5943 *t*t*t*t-7.041*t*t*t+52.96*t*t-183.3*t+664.7); GoalPos18[1]=GoalPos18[0]; 
      Posicao(); 
     } 

     PrintErrorCode(); 

     // Read present position 
     wPresentPos = dxl_read_word(id, P_PRESENT_POSITION_L); 
     TxDWord16(GoalPos[INDEX]); 
     TxDString(" "); 
     TxDWord16(wPresentPos); 
     TxDByte_PC('\r'); 
     TxDByte_PC('\n'); 
    } 
    else 
     PrintCommStatus(CommStatus); 
    t = t + 0.01; 
} 
return 0;} 

,이 메시지를주고있어 임베디드 DX34 READ_WRITE/APP/src/main.c : 179 : 정의되지 않은 참조 __aeabi_dcmple' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dmul ' C : \ Users \ Ghost \ Dropbox \ Gilmar \ Dropbox \ L008 - Bloco Delta \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c : 179 : 정의되지 않은 참조 __aeabi_dadd' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_d2iz ' C : \ Users \ Gilmar \ Dropbox \ L008 - Bloco 델타 \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c : 179 : 정의되지 않은 참조 __aeabi_dmul' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dadd ' C : \ Users \ Gilmar \ Dropbox \ L008 - Bloco Delta \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c : 179 : 정의되지 않은 참조 __aeabi_d2iz' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dmul ' C : \ Users \ Gilmar \ Dropbox \ L008 - bloco 델타 \ trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c : 179 : 정의되지 않은 참조 __aeabi_dmul' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dmul ' C : \ Users \ Gilmar \ Dropbox \ L008 - Bloco Delta \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c : 179 : 정의되지 않은 참조 __aeabi_dmul' C:\Users\Gilmar\Dropbox\L008 - Bloco Delta\Trabalho\pdpd\PDPD LIBS\CM530\09 DXL READ_WRITE/APP/src/main.c:179: undefined reference to __aeabi_dmul ' APP/src/main.o : C : \ Users \ Gilmar \ Dropbox \ L008 - Bloco Delta \ Trabalho \ pdpd \ PDPD LIBS \ CM530 \ 09 DXL READ_WRITE/APP/src/main.c : 179 : 더 많은 정의되지 않은 참조 t o`__aeabi_dmul '따르십시오

어떻게이 문제를 해결할 수 있습니까? 내가 t = t + 0.01 행에 주석을 달았을 때 코드는 작동하지만 0.01를 더해야합니다. 나는 float, double, int로 숫자를 외 웠을 때 어떤 숫자로 시도해 보았습니다. 작품은 제 문제에 불과합니다.

+1

[정의되지 않은 참조/확인되지 않은 외부 기호 오류 란 무엇이며 어떻게 수정합니까?] (http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved- 외부 기호 오류 및 어떻게해야합니까 - 수정) – Olaf

+0

**이 코드를 실행하지 않아도됩니다 **! Sidenote : 그 아치에 부동 소수점 이하의 'double'을 사용하지 마십시오! 정수와 함께 고정 소수점 산술을 사용하십시오. (참고 : 그것은 또한 당신의 문제에 대한 이유입니다, 누락 된 기호의 이름을 이해하려고 노력하십시오!) – Olaf

+0

그리고 "임베디드 C"가 없습니다. – Olaf

답변

1

귀하의 컴파일러는 부동 소수점 산술을 처리하기 위해 소프트 플로트 라이브러리를 구현해야합니다. 정의되지 않은 기호는 컴파일러가 유동적 인 float 구현과 연결되어 있지 않음을 나타냅니다.

이중 정밀도가 필요한지 잘 모르겠지만 가능한 경우 사용하지 말라고 조언합니다. 단 정밀도 부동 소수점은 아키텍처에 덜 고통 스럽습니다. 컴파일러가 적절한 부동 소수점 ABI를 사용하도록 설정되어 있고 적절한 소프트 플로트 구현을 사용할 수 있어야합니다. Cortex M3에는 하드웨어 부동 소수점 유닛이 없습니다.

+1

코드를 읽는다! 어쨌든 플로트에 대한 진정한 필요는 없습니다. – Olaf