2008-10-27 4 views
5

timesys arm-gcc toolchain에서 1.35.0과 1.36.0을 빌드하는 데 아무런 문제가 없습니다. 정적 (link-static)과 동적 (.so, default 선택권). 그러나gcc-arm toolchain 용 Boost C++ 라이브러리

, 나는 간단한 샘플 파일 시스템 응용 프로그램 연결하려고 :

#include <boost/filesystem.hpp> 
#include <iostream> 

namespace fs = boost::filesystem; 

int main(int argc, char *argv[]) { 
    const char* fileName = argv[1]; 
    std::cout << "file: " << fileName << " => " << fs::exists(fileName) << std::endl; 
    return 0; 
} 

을 나는 다음과 같은 링커 오류 얻을 :


[email protected]:~/boost/test$ /opt/timesys/at91sam9263_ek/toolchain/bin/armv5l-timesys-linux-gnueabi-gcc 
    exists.cpp -o exists.exe -I ../boost_1_35_0/ -lboost_filesystem -lboost_system -lstdc++ -L . 

/tmp/ccex3NGb.o: In function `boost::detail::atomic_decrement(int*)': 
exists.cpp:(.text._ZN5boost6detail16atomic_decrementEPi[boost::detail::atomic_decrement(int*)]+0x1c): 
    undefined reference to `__sync_fetch_and_add_4' 

/tmp/ccex3NGb.o: In function `boost::detail::atomic_increment(int*)': 
exists.cpp:(.text._ZN5boost6detail16atomic_incrementEPi[boost::detail::atomic_increment(int*)]+0x1c): 
    undefined reference to `__sync_fetch_and_add_4' 

collect2: ld returned 1 exit status 

사람 내가 위해 구축 부스트를 얻을 수있는 방법을 알고 있나요을 gcc-arm toolchain?

답변

3

당신은 파일에 'boost_1_35_0/부스트/설정/user.hpp'를 추가해야합니다

#define BOOST_SP_USE_PTHREADS 

이 BTW, 당신이 파일의 GCC 툴 체인을 설정해야 'boost_1_35_0/도구/건설/V2 /user-config.jam '을 다음과 같이 변경하십시오 :

using gcc 
     : arm 
     : /opt/timesys/at91sam9263_ek/toolchain/bin/armv5l-timesys-linux-gnueabi-gcc 
; 

이것은 이제 연결 문제를 해결합니다.

3

Boost 메일 링리스트에서 거의 동일한 질문이 here으로 대답되었습니다.