gpt4 book ai didi

c++ - MSYS2 上 gcc 8.2.1 的 Eigen 编译错误

转载 作者:搜寻专家 更新时间:2023-10-31 01:27:11 61 4
gpt4 key购买 nike

我们是facing errors针对 MSYS2 提供的最新版本的 GCC 8.2.1 针对 Eigen 3.3.7(可能还有旧版本)进行编译。奇怪的是,这只发生在同一包的最新版本中(mingw-w64-x86_64-gcc 8.2.1):

  • 8.2.1+20181123-1 : 很好
  • 8.2.1+20181130-1 : 错误
  • 8.2.1+20181207-1 : 错误

错误是:

In file included from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/SparseCore:50,
from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Sparse:26,
from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Eigen:2,
from src/registration/transform/search.h:21,
from src/registration/transform/initialiser_helpers.cpp:20:
C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/src/SparseCore/SparseBlock.h: In member function 'Eigen::internal::sparse_matrix_block_impl<SparseMatrixType, BlockRows, BlockCols>::BlockType& Eigen::internal::sparse_matrix_block_impl<SparseMatrixType, BlockRows, BlockCols>::operator=(const BlockType&)':
C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/src/SparseCore/SparseBlock.h:216:33: error: expected primary-expression before '>' token
return operator=<BlockType>(other);

^

我假设这是 MSYS2 提供的 GCC 包中的错误,而不是 Eigen(据我所知,SparseBlock.h 文件有一段时间没有更改) .不同的 GCC 版本是否基于相同的源代码?知道可能是什么问题吗?


编辑:这是一个 MCVE:

测试.cpp:

#include <Eigen/Eigen>
int main () { return 0; }

使用 g++ 8.2.1(版本 8.2.1+20181130-1 或更高版本 - 旧版本没有错误)编译:

$ g++ $(pkg-config --cflags eigen3) test.cpp -o test
In file included from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/SparseCore:50,
from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Sparse:26,
from C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/Eigen:2,
from test.cpp:1:
C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/src/SparseCore/SparseBlock.h: In member function 'Eigen::internal::sparse_matrix_block_impl<SparseMatrixType, BlockRows, BlockCols>::BlockType& Eigen::internal::sparse_matrix_block_impl<SparseMatrixType, BlockRows, BlockCols>::operator=(const BlockType&)':
C:/Users/donald/msys64/mingw64/include/eigen3/Eigen/src/SparseCore/SparseBlock.h:216:33: error: expected primary-expression before '>' token
return operator=<BlockType>(other);
^

最佳答案

进一步调查表明这确实是一个 GCC 错误。我有 reported this on GCC Bugzilla ,然后我将关闭此线程。谢谢!

关于c++ - MSYS2 上 gcc 8.2.1 的 Eigen 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53842888/

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