티스토리 뷰

반응형

 

C99는 C 언어의 현대 개정판이자, C 언어 표준의 과거판인 ISO/IEC 9899:1999의 비공식 이름 (출처: 위키피디아)

컴파일러에게 C99 모드로 컴파일하라는 옵션을 주어야 한다고 함

 

환경변수 CFLAGS 에 -std=c99 옵션을 세팅하고 설치한다.

  • 리눅스에서는 터미널 창에서 'export CFLAGS=-std=c99'

  • JupyterLab에서는 '%env CFLAGS=-std=c99'

참고) https://stackoverflow.com/questions/2935047/how-to-use-make-and-compile-as-c99

    for(int i=0; i<nsteps; i++) {
       ^
    dtw/dtw_computeCM.c:144:11: error: redefinition of ‘i’
       for(int i=0; i<m*n; i++)
               ^
    dtw/dtw_computeCM.c:119:11: note: previous definition of ‘i’ was here
       for(int i=0; i<nsteps; i++) {
               ^
    dtw/dtw_computeCM.c:144:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
       for(int i=0; i<m*n; i++)
       ^
    dtw/dtw_computeCM.c:149:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
       for(int j=0; j<m; j++) {
       ^
    dtw/dtw_computeCM.c:150:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for(int i=0; i<n; i++) {
         ^
    dtw/dtw_computeCM.c:51:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
       for(int z=0; z<npats; z++) \
       ^
    dtw/dtw_computeCM.c:160:7: note: in expansion of macro ‘CLEARCLIST’
           CLEARCLIST;
           ^
    dtw/dtw_computeCM.c:161:7: error: ‘for’ loop initial declarations are only allowed in C99 mode
           for(int s=0; s<nsteps; s++) {
           ^
    error: command 'gcc' failed with exit status 1

 

반응형
댓글
최근에 올라온 글