MSYS2上gcc 8.2.1的本征编译错误 [英] Eigen compilation error with gcc 8.2.1 on MSYS2

查看:98
本文介绍了MSYS2上gcc 8.2.1的本征编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在面对错误针对Eigen 3.3.7(可能是较旧的版本)进行了编译),而不是MSYS2提供的最新版本的GCC 8.2.1。奇怪的是,这仅在相同软件包的最新版本中发生( mingw-w64-x86_64-gcc 8.2.1):

We are facing errors compiling against Eigen 3.3.7 (and probably older versions) against the latest versions of GCC 8.2.1 supplied by MSYS2. Strangely, this only happens with the latest builds of the same package (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);

                             ^

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

I'm assuming this is a bug in the GCC package supplied by MSYS2, rather than Eigen (the SparseBlock.h file hasn't changed for a while, as far as I can tell). Are the different GCC builds based on the same source code? Any idea what the issue might be?

编辑:这是MCVE:

test.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错误。我已经在GCC Bugzilla上报告了此情况,我将关闭这个线程。谢谢!

Further investigation suggests this is indeed a GCC bug. I've reported this on GCC Bugzilla, and I'll close this thread. Thanks!

这篇关于MSYS2上gcc 8.2.1的本征编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆