2013-07-16 2 views
8

Windows와 Eclipse에서 Android ndk로 부스트 라이브러리를 사용하려고합니다. 나도 따라 봤는데 this tutorialWindows에서 android ndk의 부스트 사용

나는 cygwin에서 "bjam"명령으로 단계에 갇혀있다.

bjam --without-직렬화 도구 세트 = GCC-android4.4.3 링크 = 정적 런타임 링크 = 정적 목표 운영 체제 = 리눅스 파이썬 --without --stagedir = 안드로이드

오류 : bjam 명령을 찾을 수 없습니다 .

bjam이란 무엇입니까? 또한 ndk r8e에 따라 1.53을 사용했습니다. 누군가 제발 도와 드릴까요?

답변

18

Android NDK는 더 이상 Cygwin에 종속되지 않으므로 Windows 명령 프롬프트 (cmd)에서 NDK로 부스트를 작성할 수 있습니다. 의 NDK를 찾을 Boost.Buildboost\tools\build\v2\user-config.jam 파일을 편집하고 다음 텍스트 추가하기 위해

: 물론

import os ; 

androidNDKRoot = C:/android-ndk-r8e ; # put the relevant path 
using gcc : android : 
    $(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-g++ : 
    <compileflags>--sysroot=$(androidNDKRoot)/platforms/android-9/arch-arm 
    <compileflags>-mthumb 
    <compileflags>-Os 
    <compileflags>-fno-strict-aliasing 
    <compileflags>-O2 
    <compileflags>-DNDEBUG 
    <compileflags>-g 
    <compileflags>-lstdc++ 
    <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/include 
    <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi/include 
    <compileflags>-D__GLIBC__ 
    <compileflags>-D_GLIBCXX__PTHREADS 
    <compileflags>-D__arm__ 
    <compileflags>-D_REENTRANT 
    <archiver>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-ar 
    <ranlib>$(androidNDKRoot)/toolchains/arm-linux-androideabi-4.7/prebuilt/windows/bin/arm-linux-androideabi-ranlib 
     ; 

을 대신 c:/android-ndk-r8e 당신은 당신의 PC에 NDK의 올바른 위치를 넣어해야합니다.

게다가 android-9 대신 최신 플랫폼 API를 선택할 수 있습니다.

또한 NDK는 여러 가지 도구 체인을 제공하며 위의 설정은 gcc-4.7을 가리 킵니다. 다른 도구 체인을 사용하여 부스트를 구현하려면 arm-linux-androideabi-4.7을 관련 경로로 변경하십시오.

user-config.jam에 구성을 입력 한 후 Boost가있는 디렉토리에 cmd, cd을 열고 bootstrap을 호출하십시오. 2천15분의 11로, 이전 NDK 툴체인은 컴파일러 충돌을 일으키는 새로운 부스트 버전과 문제를 갖고있는 것 같다, 그래서 사용을 고려 :

b2 --without-python --without-serialization threading=multi link=static runtime-link=static toolset=gcc-android target-os=linux threadapi=pthread --stagedir=android stage

UPDATE을 : 다음 (예를 들어)이 같은 b2를 호출 최근의 컴파일러. 이렇게하려면 위 스크립트에서 4.7 번 발생을 4.9로 변경하십시오. 또한 최신 Android API (예 : andoroid-9 - andoroid-16 정도)를 사용하여 컴파일하는 것이 좋습니다.

+0

D : \ android_ndk_with_boost 안드로이드 NDK-r8e의 \ 소스 \ boost_1_53_0 \ 도구 \ 구축 \ V2> B2 --without-파이썬 --without-직렬화 스레딩 = 멀티 링크 = 정적 런타임 리 NK = 정적 도구 세트 \ = gcc-android4.6 target-os = linux threadapi = pthread --stagedir = an droid D :/android_ndk_with_boost/android-ndk-r8e/sources/boost_1_53_0/tools/build/v2/to ols \ gcc.jam : 78 : gcc.init in module gcc 오류 : toolset gcc 초기화 : 오류 : 제공된 명령 'D : and android-ndk-rbe/bin/arm-linux-androideabi-g ++ '이 없습니다. d – user2508941

+0

이 오류가 발생했습니다. ... 죄송합니다. 함께 넣을 수 없습니다. – user2508941

+0

@ user2508941 "toolset = gcc-android4.6"이 무엇입니까? user-config.jam에서 어떻게 정의 했습니까? (pastebin.com 또는 유사 사이트를 사용하여 오류를 넣으십시오.) –

관련 문제