arm linux gcc boost,為gcc-arm工具鏈提升C ++庫

I have no trouble building 1.35.0, as well as 1.36.0 on the timesys arm-gcc toolchain, both statically (link-static) as well as dynamically (.so, default option).

構建1.35.0以及在timesys arm-gcc工具鏈上的1.36.0,無論是靜態(鏈接靜態)還是動態(.so,默認選項)都沒有問題。

However, when I try to link a simple sample filesystem app:

但是,當我嘗試鏈接一個簡單的示例文件系統應用程序時:

#include

#include

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;

}

I get the following linker error:

我收到以下鏈接器錯誤:

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

Does anyone know how I can get Boost to build for the gcc-arm toolchain?

有誰知道如何讓我的Boost為gcc-arm工具鏈構建?

2 个解决方案

#1

3

An almost identical question was answered here on the Boost mailing list.

在Boost郵件列表中回答了幾乎完全相同的問題。

#2

3

You need to add in file 'boost_1_35_0/boost/config/user.hpp':

您需要添加文件'boost_1_35_0 / boost / config / user.hpp':

#define BOOST_SP_USE_PTHREADS

btw, you need to set the gcc tool-chain in file 'boost_1_35_0/tools/build/v2/user-config.jam' to:

順便說一句,你需要將文件'boost_1_35_0 / tools / build / v2 / user-config.jam'中的gcc工具鏈設置為:

using gcc

: arm

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

;

This will solve the problem of linking now.

這將解決現在鏈接的問題。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值