使用英特尔线程构建块编译:错误操作数为?:
Compiling with Intel Threading Building Blocks: error operands to ?:
当前,我尝试编译OpenVDB,这取决于螺纹构建块。我收到以下错误:
In file included from /usr/include/tbb/enumerable_thread_specific.h:32:0,
from ../openvdb/tools/Morphology.h:59,
from ../openvdb/tools/MultiResGrid.h:64,
from cmd/openvdb_lod/main.cc:32:
/usr/include/tbb/concurrent_vector.h: In member function ‘tbb::concurrent_vector<T, A>::iterator tbb::concurrent_vector<T, A>::grow_by(tbb::concurrent_vector<T, A>::size_type)’:
/usr/include/tbb/concurrent_vector.h:667:38: error: operands to ?: have different types ‘tbb::internal::concurrent_vector_base_v3::size_type {aka long unsigned int}’ and ‘tbb::atomic<long unsigned int>’
return iterator(*this, delta ? internal_grow_by( delta, sizeof(T), &initialize_array, NULL ) : my_early_size);
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/tbb/concurrent_vector.h:667:38: note: and each type can be converted to the other
/usr/include/tbb/concurrent_vector.h: In member function ‘tbb::concurrent_vector<T, A>::iterator tbb::concurrent_vector<T, A>::grow_by(tbb::concurrent_vector<T, A>::size_type, tbb::concurrent_vector<T, A>::const_reference)’:
/usr/include/tbb/concurrent_vector.h:680:38: error: operands to ?: have different types ‘tbb::internal::concurrent_vector_base_v3::size_type {aka long unsigned int}’ and ‘tbb::atomic<long unsigned int>’
return iterator(*this, delta ? internal_grow_by( delta, sizeof(T), &initialize_array_by, static_cast<const void*>(&t) ) : my_early_size);
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/tbb/concurrent_vector.h:680:38: note: and each type can be converted to the other
make: *** [vdb_lod] Error 1
简而言之,作为第二和第三个参数,操作员获得了一种基本类型,并且包裹在tbb::atomic
中的相同基本类型,而编译器不知道将哪种类型用作返回值。
不必说,我无意更改该源代码。由于它们是建立的产品,因此可以肯定地说我在编译时做错了什么。
TBB库文件似乎是使用GCC的旧版本构建的,即4.7。我最初认为问题可能是我使用了GCC 7.2.0,因此我尝试了不同版本,例如GCC 4.8.5,但错误仍然存在。
我没有特别尝试过4.7,因为我在没有管理员权利的公司工作,并且试图避免在本地安装GCC。特别是因为我不知道GCC是否在这里是问题。
有人知道解决这个问题吗?
编辑:https://software.intel.com/en-us/forums/intel-threading-building-blocks/topic/417161似乎与同一问题有关那里。但是,该帖子是从2013年开始的,由于人们在之间使用了TBB,因此一般而言,我一定会做一些与众不同的事情。
看起来使用过时的TBB版本。请参阅TBB论坛上的类似问题。
相关文章:
- 错误 C2679:二进制"<<":未找到采用类型 'std::string_view' 的右侧操作数的运算符(或者没有可接受的转换)
- 错误:类型"double()"和"double()"的操作数无效到二进制&quo
- 错误:二进制'operator*' 'float'和'float[0]'类型的操作数无效
- 错误 C2679 二进制"<<":未找到采用类型为 'T' 的右侧操作数的运算符
- 错误:'operator>'不匹配(操作数类型为 'Student' 和 'Student'
- 如何摆脱逗号运算符的这个错误右操作数没有效果( wunsued 值)?
- c++ 错误:二进制"运算符+"类型"矩阵*"和"矩阵*"的操作数无效
- 使用堆栈编译错误的 C++ 反向行没有运算符匹配操作数
- 当我尝试构建此程序时,出现此错误:需要左键作为赋值的左操作数
- 错误:二进制">>":未找到采用类型为"const char [1] 的右操作数的运算符
- C++ 重载:[错误] 与'operator='不匹配(操作数类型为 'String' 和"字符串")
- 错误 C2679:二进制'<<':找不到采用类型 'overloaded-function' 的右侧操作数的运算符(或者没有可接受的转换)
- 我收到一个错误无效的操作数,类型为 const char [42] 和二进制"运算符+"的双倍数
- 错误:与"运算符>>"不匹配(操作数类型为"std::istream
- 错误:C2679 二进制"==":未找到采用类型 'const std::string' 的右侧操作数的运算符(或者没有可接受的转换)
- 错误:与'operator='不匹配(操作数类型为 'PlDrustvo' 和"PlDrustvo")|
- 错误:"->"的基本操作数具有非指针类型"const"
- 使用英特尔线程构建块编译:错误操作数为?:
- 错误:操作数不匹配
- C++错误(操作数类型为"std::string 和 'void")