moo*_*oom 8 c++ c++14 gcc5 ubuntu-16.04 proxygen
我想用Ubuntu 16.04从github构建Facebook的Proxygen c ++ http库.这是我设置的环境以及用于安装依赖项的deps.sh命令:
gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609
export CPPFLAGS="-std=c++14"
export CXXFLAGS="-std=c++14"
git clone git@github.com:facebook/proxygen.git
cd proxygen/proxygen && ./deps.sh
Run Code Online (Sandbox Code Playgroud)
这通过构建其愚蠢的依赖关系得到了我的大部分,但我得到了一个不完整的类型错误:
libtool: compile: g++ -DHAVE_CONFIG_H -I./.. -pthread -I/usr/include -std=c++14 -std=gnu++1y -std=c++14 -MT io/async/AsyncPipe.lo -MD -MP -MF io/async/.deps/AsyncPipe.Tpo -c io/async/AsyncPipe.cpp -fPIC -DPIC -o io/async/.libs/AsyncPipe.o
In file included from /usr/include/c++/5/bits/move.h:57:0,
from /usr/include/c++/5/bits/stl_pair.h:59,
from /usr/include/c++/5/utility:70,
from /usr/include/c++/5/algorithm:60,
from ./../folly/Conv.h:26,
from Conv.cpp:16:
/usr/include/c++/5/type_traits: In instantiation of ‘struct std::make_unsigned<__int128>’:
Conv.cpp:528:52: required from ‘folly::detail::ConversionResult<T> folly::detail::digits_to(const char*, const char*) [with Tgt = __int128]’
Conv.cpp:658:16: required from here
/usr/include/c++/5/type_traits:1757:62: error: invalid use of incomplete type ‘class std::__make_unsigned_selector<__int128, false, false>’
{ typedef typename __make_unsigned_selector<_Tp>::__type type; };
^
/usr/include/c++/5/type_traits:1721:11: note: declaration of ‘class std::__make_unsigned_selector<__int128, false, false>’
class __make_unsigned_selector;
^
/usr/include/c++/5/type_traits: In instantiation of ‘struct std::make_unsigned<__int128 unsigned>’:
Conv.cpp:528:52: required from ‘folly::detail::ConversionResult<T> folly::detail::digits_to(const char*, const char*) [with Tgt = __int128 unsigned]’
Conv.cpp:661:16: required from here
Run Code Online (Sandbox Code Playgroud)
有没人试过或解决过这个问题?我还不熟悉代码库.蒂亚.
TL; DR Proxygen需要GNU扩展; 用-std=gnu++11或-std=gnu++14
为什么在构建proxygen及其依赖项时需要覆盖C++标准?愚蠢本身指定-std=gnu++1y.如果你删除
export CPPFLAGS="-std=c++14"
export CXXFLAGS="-std=c++14"
Run Code Online (Sandbox Code Playgroud)
并试图建立它,它几乎将,我必须做的唯一的变化是愚蠢的修复membarrier.
如果你坚持使用-std=c++14,那么问题实际上并不是愚蠢的,而是在libstdc ++处理GNU扩展,这个简单的行:
typedef std::make_unsigned<__int128>::type int128_type;
Run Code Online (Sandbox Code Playgroud)
将很容易编译-std=gnu++11或-std=gnu++1y,但将与任何-std=c++11或-std=c++14.并且很难说,它是否是一个错误(因为编译器提供__int128类型(并且在其配置脚本中愚蠢地检测到BTW)但是C++库存在问题)或者一个功能(因为__int128它首先是一个扩展,一个人应该使用一些标准的GNU变体来正确地获得它.
| 归档时间: |
|
| 查看次数: |
991 次 |
| 最近记录: |