GCC-Arm 툴체인의 C ++ 라이브러리 부스트
문제
Timesys ARM-GCC 툴체인에서 1.35.0을 구축하는 데 어려움이 없습니다.
그러나 간단한 샘플 파일 시스템 앱을 연결하려고 할 때 :
#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;
}
다음 링커 오류가 발생합니다.
developer@eldp01:~/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 도구 체인을 위해 어떻게 부스트를 구축 할 수 있는지 아는 사람이 있습니까?
해결책 2
'boost_1_35_0/boost/config/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 ;
이것은 지금 링크 문제를 해결할 것입니다.
다른 팁
거의 동일한 질문에 대답했습니다 여기 부스트 메일 링리스트에서.
제휴하지 않습니다 StackOverflow