boost_local 库连接时报错误

报错

/root/Downloads/boost_1_57_0/stage/lib/libboost_locale.a(codepage.o):in fuction ‘boost::locale::conv::impl::uconv_to_utf<wchar_t>::open(char const*, boost::locale::conv::method_type)’:
codepage.cpp:(.text._ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE[_ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE]+0xb0):undefined reference to ‘ucnv_open_50’未定义的引用
codepage.cpp:(.text._ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE[_ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE]+0xcd):undefined reference to ‘ucnv_close_50’未定义的引用
codepage.cpp:(.text._ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE[_ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE]+0x146):undefined reference to ‘UCNV_FROM_U_CALLBACK_STOP_50’
codepage.cpp:(.text._ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE[_ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE]+0x14e):undefined reference to ‘ucnv_setFromUCallBack_50’
codepage.cpp:(.text._ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE[_ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE]+0x16b):undefined reference to ‘UCNV_TO_U_CALLBACK_STOP_50’
codepage.cpp:(.text._ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE[_ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE]+0x17b):undefined reference to ‘ucnv_setToUCallBack_50’
codepage.cpp:(.text._ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE[_ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE]+0x18f):undefined reference to ‘ucnv_getMaxCharSize_50’
codepage.cpp:(.text._ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE[_ZN5boost6locale4conv4impl12uconv_to_utfIwE4openEPKcNS1_11method_typeE]+0x1a2):undefined reference to ‘ucnv_close_50’

原因

编译boost_local时,打开了“ICU4C“

解决方法

  • 第一种:在编译工程时,makefile中增加一行 pkg-config --libs --cflags icu-uc icu-io,参考link
eg:
c++ -o test test.c `pkg-config --libs --cflags icu-uc icu-io`
  • 第二种:重新编译boost_local 编译选项 set boost.locale.icu=off

重新编译

解决问题

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值