gpt4 book ai didi

c++ - 特征张量问题 : Conflicting declaration

转载 作者:行者123 更新时间:2023-12-01 14:55:10 24 4
gpt4 key购买 nike

我刚刚尝试使用 GCC 4.9 测试 CodeBlocks 16.01 中的 Eigen Tensor 模块。正如 http://eigen.tuxfamily.org/index.php?title=Tensor_support 所建议的那样我添加了 -std=c++0x、-std=c++11 或 -std=c++1y 作为编译器标志,但我无法让它工作。已经

#include <unsupported/Eigen/CXX11/Tensor>

根据我使用的标志产生错误消息。在 -std=c++0x 或 -std=c++11 的情况下
||=== Build: Debug in Test (compiler: GNU GCC Compiler) ===|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\Tensor|52|error: conflicting declaration 'typedef long int int32_t'|
C:\Program Files (x86)\CodeBlocks\MinGW\include\stdint.h|31|note: previous declaration as 'typedef int int32_t'|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\Tensor|53|error: conflicting declaration 'typedef long unsigned int uint32_t'|
C:\Program Files (x86)\CodeBlocks\MinGW\include\stdint.h|32|note: previous declaration as 'typedef unsigned int uint32_t'|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

在 -std=c++1y 的情况下,我会收到其他错误消息:
||=== Build: Debug in Test (compiler: GNU GCC Compiler) ===|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\util\IntegralConstant.h|187|error: template declaration of 'const Eigen::internal::FixedInt<N> Eigen::fix'|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\util\IndexedViewHelper.h|63|error: 'fix' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\util\IndexedViewHelper.h|63|error: expected primary-expression before ')' token|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|142|error: 'fix' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|142|error: 'fix' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|142|error: expected primary-expression before ')' token|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h||In member function 'decltype (Eigen::seqN((((const Eigen::ArithmeticSequence<FirstType, SizeType, IncrType>*)this)->Eigen::ArithmeticSequence<FirstType, SizeType, IncrType>::m_first + ((((((const Eigen::ArithmeticSequence<FirstType, SizeType, IncrType>*)this)->Eigen::ArithmeticSequence<FirstType, SizeType, IncrType>::m_size + <expression error>) < (-1)) > <expression error>) * ((const Eigen::ArithmeticSequence<FirstType, SizeType, IncrType>*)this)->Eigen::ArithmeticSequence<FirstType, SizeType, IncrType>::|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|143|error: 'fix' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|143|error: expected primary-expression before ')' token|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|207|error: 'fix' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|207|error: 'fix' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|207|error: expected primary-expression before ')' token|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h||In function 'decltype (Eigen::seqN((typename Eigen::internal::cleanup_index_type<FirstType>::type)(f), (((((typename Eigen::internal::cleanup_index_type<SizeType>::type)(l) - (typename Eigen::internal::cleanup_index_type<FirstType>::type)(f)) + <expression error>) < 1) > <expression error>))) Eigen::seq(FirstType, LastType)':|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|211|error: 'fix' was not declared in this scope|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\..\..\..\Eigen\src\Core\ArithmeticSequence.h|211|error: expected primary-expression before ')' token|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\Tensor|52|error: conflicting declaration 'typedef long int int32_t'|
C:\Program Files (x86)\CodeBlocks\MinGW\include\stdint.h|31|note: previous declaration as 'typedef int int32_t'|
C:\Program Files (x86)\CodeBlocks\eigen-eigen-c2947c341c68\unsupported\Eigen\CXX11\Tensor|53|error: conflicting declaration 'typedef long unsigned int uint32_t'|
C:\Program Files (x86)\CodeBlocks\MinGW\include\stdint.h|32|note: previous declaration as 'typedef unsigned int uint32_t'|
||=== Build failed: 15 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

关于我做错了什么或如何解决它的任何想法?
提前致谢

最佳答案

那可能是因为你的编译器不支持 variable template .
自 gcc 5 起支持变量模板。

https://www.gnu.org/software/gcc/projects/cxx-status.html

您可以升级编译器或修改特征源代码。

关于c++ - 特征张量问题 : Conflicting declaration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47909617/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com