Boost-1.53.0 在ubuntu下编译出现./boost/atomic/atomic.hpp:166:16: error: ‘uintptr_t’ was not declared错误

4 篇文章 0 订阅
4 篇文章 0 订阅

在linux环境下编译出现如下错误:

gcc.compile.c++ bin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi/lockpool.o
In file included from ./boost/atomic.hpp:12:0,
                 from libs/atomic/src/lockpool.cpp:1:
./boost/atomic/atomic.hpp:166:16: error: ‘uintptr_t’ was not declared in this scope
 typedef atomic<uintptr_t> atomic_uintptr_t;
                ^
./boost/atomic/atomic.hpp:166:25: error: template argument 1 is invalid
 typedef atomic<uintptr_t> atomic_uintptr_t;
                         ^
./boost/atomic/atomic.hpp:166:43: error: invalid type in declaration before ‘;’ token
 typedef atomic<uintptr_t> atomic_uintptr_t;
                                           ^

    "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread  -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_SOURCE -DNDEBUG  -I"." -c -o "bin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp"

...failed gcc.compile.c++ bin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi/lockpool.o...
...skipped <pbin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi>libboost_atomic.a(clean) for lack of <pbin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi>lockpool.o...
...skipped <pbin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi>libboost_atomic.a for lack of <pbin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi>lockpool.o...
...skipped <p../install/lib>libboost_atomic.a for lack of <pbin.v2/libs/atomic/build/gcc-4.8/release/link-static/threading-multi>libboost_atomic.a...

********************************************************分割线****************************************************************

参考链接地址:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739904

简单修改描述:

vi ./boost_1_53_0/boost/cstdint.hpp +43

将#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG))替换为

#if defined(BOOST_HAS_STDINT_H)                                 \
                   && (!defined(__GLIBC__)                                       \
                       || defined(__GLIBC_HAVE_LONG_LONG)                        \
                       || (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17)))))

再次编译boost库就可以。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值