cocos2d-x curl 사용시 빌드 문제 해결

fatal error: curl/curl.h: No such file or directory

C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:79:4: error: #error "CURL_SIZEOF_LONG definition is missing!"
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:94:4: error: #error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:99:4: error: #error "CURL_FORMAT_CURL_OFF_T definition is missing!"
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:104:4: error: #error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:109:4: error: #error "CURL_FORMAT_OFF_T definition is missing!"
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:114:4: error: #error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:119:4: error: #error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:124:4: error: #error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"

C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h: At global scope:
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:80:4: error: 'Error' does not name a type
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:153:6: error: 'curl_off_t' was not declared in this scope
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:153:6: error: 'CURL_SIZEOF_CURL_OFF_T' was not declared in this scope
C:/Android/cocos2d-2.0-rc2-x-2.0.1/cocos2dx/platform/third_party/win32/curl/curlrules.h:163:6: error: 'curl_off_t' was not declared in this scope

build_native.sh 하실 때 위와같은 에러가 나온다면 proj.android/jni/Android.mk 파일에 아래의 내용을 추가해줍니다.

LOCAL_STATIC_LIBRARIES := curl_static_prebuilt
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl)

적절한 위치에 추가해주면 되구요, 개발 소스에 curl/curl.h 를 include한 부분만 조심하시면 됩니다. platform/third_party/win32/curl/curl.h 를 include 하시면 안되겠죠? 크로스플랫폼 개발이니까요. 그냥 curl/curl.h ~

혹시 위처럼 해서 안되시는 분들은 제경우 cocos2d-x 버전을 올리면서 libcurl의 LOCAL_MODULE 명이 바껴서 안되던데 curl_static_prebuilt 대신 cocos_curl_static 로 하면 됩니다.

LOCAL_STATIC_LIBRARIES := cocos_curl_static 이렇게요.

댓글

이 블로그의 인기 게시물

'xxx.exe' 프로그램을 시작할 수 없습니다. 지정된 파일을 찾을 수 없습니다.

goorm IDE에서 node.js 프로젝트로 Hello World Simple Server 만들어 띄워보기

애드센스 수익을 웨스턴 유니온으로 수표대신 현금으로 지급 받아보자.