Blog

cocos2d v3에서 Implicit declaration of function ‘ccDrawColor4B’ is invalid in C99 해결 방법

March 24, 2014

cocos2d v3에서 Implicit declaration of function ‘ccDrawColor4B’ is invalid in C99 해결 방법

2012년 6월 8일 cocos2d에서 implicit declaration of ‘glColor4ub’ is invalid in c99 해결방법 글로 블로깅을 한적이 있다. 저 때는 v1->v2로 변경을 하는 과정에서 생긴 이슈 였는데, v2->v3로 갈려니 또 비슷한 에러가 발생한다. 


Implicit declaration of function ‘ccDrawColor4B’ is invalid in C99 에러가 뜬다.


간단하게 CCDrawingPrimitives.h 헤더파일만 임포트 하면 해결된다. 삽질 30분 해결 완료. 

#import “CCDrawingPrimitives.h”


– (void) draw{

    glLineWidth(maxSize.height);

    ccDrawColor4B(255, 255, 255, 255);

    ccDrawLine(ccp(0, 0), ccp(1, 0));

    ccDrawLine(ccp(maxSize.width / 21, 0), ccp(maxSize.width / 2, 0 ));

    ccDrawLine(ccp(maxSize.width1, 0), ccp(maxSize.width, 0 ));

    

    CGFloat width = currentValue;

    glLineWidth(maxSize.height);

    ccDrawColor4B(0, 0, 255, 255);

    if (currentValue < 0)

        ccDrawLine(ccp(maxSize.width / 21, 0), ccp(width + maxSize.width / 2, 0));

    else

        ccDrawLine(ccp(maxSize.width / 2, 0), ccp(width + maxSize.width / 2, 0));

  

}

저작자 표시
비영리
Array