마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

ndk를 통해 box2d를 사용하고 싶은데 잘안됩니다.

0 추천

 

box2D소스를   . a 형태인 정적라이브러리로 만드는것 까지는 성공하였는데

이것을 사용하기위해  box2D의 헤더파일들을   어떻게 위치해야 되는지 도무지 모르겠습니다.

그냥 jni폴더 밑에 놔두고 소스내에서 #include <Box2D/Box2D.h> 이렇게 프로젝트에 추가시키면

 

/Users/skj4522/Documents/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_algo.h:5907: error: expected declaration specifiers before 'template'

/Users/skj4522/Documents/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_algo.h:5973: error: expected declaration specifiers before 'template'

/Users/skj4522/Documents/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_algo.h:6030: error: expected declaration specifiers before 'template'

/Users/skj4522/Documents/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_algo.h:6058: error: expected declaration specifiers before 'template'

/Users/skj4522/Documents/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_algo.h:6086: error: expected declaration specifiers before 'template'

/Users/skj4522/Documents/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_algo.h:6114: error: expected declaration specifiers before 'template'

/Users/skj4522/Documents/android-ndk-r7c/sources/cxx-stl/gnu-libstdc++/include/bits/stl_algo.h:6136: error: expected declaration specifiers before '_GLIBCXX_END_NESTED_NAMESPACE'

In file included from /Users/skj4522/Documents/android-ndk-r7c/sources/box2d/Box2D/Box2D.h:39,

                 from jni/GLGameRenderer.c:9:

/Users/skj4522/Documents/android-ndk-r7c/sources/box2d/Box2D/Collision/b2BroadPhase.h:32: error: expected declaration specifiers before ';' token

........

jni/GLGameRenderer.c:34: error: expected '{' at end of input

 

이런식으로 에러가 뜨는데 이리 저리 해봐도 해결이 안되네요..

 stl문법때문에 안되는거라면  정적라이브러리 파일만드는거 자체가 문제가 되야될꺼같은데

이상없이 .a파일로는 만들어지는데 왜 안되는걸까요? ㅠ

 

 

대박송 (120 포인트) 님이 2013년 5월 14일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...