잘하면 간단한 대답으로 간단한 질문입니다. 코드는 C로 작성되었습니다. XC8 컴파일러에서 MPLAB IDE v1.60을 사용하고 있지만 "clock_t"를 인식하지 못합니다. 장치 PIC18F6520에 대해 MPLAB을 설정했습니다. 오류 메시지 빌드하려고하면 다음과 같습니다.clock_t가 MPLAB로 컴파일되지 않음 XC8
ClockTimer.c:16: error: undefined identifier "clock_t"
ClockTimer.c:16: error: expression syntax
ClockTimer.c:18: error: expression syntax
ClockTimer.c:19: error: undefined identifier "stop"
ClockTimer.c:19: error: undefined identifier "start"
코드는 다음과 같습니다.
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>
#include <time.h>
int main()
{
clock_t start = clock();
// Execuatable code
clock_t stop = clock();
double elapsed = (double)(stop - start) * 1000.0/CLOCKS_PER_SEC;
printf("Time elapsed in ms: %f", elapsed);
}
이것이 컴파일되지 않는 이유는 무엇입니까? clock_t는 긴 부호 단지 별칭이 종종 있기 때문에 감사 마크
컴파일러 설명서를 읽으면 라이브러리가 해당 기능을 단순히 지원하지 않을 수 있습니다. –