windows building, Eigen error?

Issue #333 new
Ben created an issue

Hi, I am trying to build on windows, and I am getting this error when I try to compile the lib:

1>c:\gtsam\3rdparty\eigen\eigen\src/Core/PlainObjectBase.h(383): error C2665: 'Eigen::internal::conservative_resize_like_impl<Derived,Derived,false>::run': none of the 2 overloads could convert all the argument types
1>          with
1>          [
1>              Derived=Eigen::Matrix<double,3,3,0,3,3>
1>          ] (compiling source file C:\gtsam\navigation\TangentPreintegration.cpp)

I have tried using the inbuilt Eigen, and also the Eigen source, and see the same error.

windows 10, visual studio 2015.

Comments (7)

  1. Jing Dong

    Hi @antithing , that's an issue we have not figure out the exact reason, but there's a quick bypass of this issue in branch fix/visualcpp14, which I manually modify a few Eigen code. I tested this branch on windows 10 + VS 2015 in static lib mode. This is a temporary solution, and I will look for cleaner solution if I have some time later..

  2. Ben reporter

    Hi, sorry to bug you again, That fix works fine, but when I use gtsam with PCL Point cloud library, I am getting this compile error:

    1>PointCloudLocalization.obj : error LNK2005: "public: __int64 __cdecl Eigen::PlainObjectBase<class Eigen::Matrix<double,3,1,0,3,1> >::rows(void)const " (?rows@?$PlainObjectBase@V?$Matrix@N$02$00$0A@$02$00@Eigen@@@Eigen@@QEBA_JXZ) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: __int64 __cdecl Eigen::PlainObjectBase<class Eigen::Matrix<double,3,3,0,3,3> >::rows(void)const " (?rows@?$PlainObjectBase@V?$Matrix@N$02$02$0A@$02$02@Eigen@@@Eigen@@QEBA_JXZ) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: class Eigen::Matrix<double,3,3,0,3,3> & __cdecl Eigen::MatrixBase<class Eigen::Matrix<double,3,3,0,3,3> >::setIdentity(__int64,__int64)" (?setIdentity@?$MatrixBase@V?$Matrix@N$02$02$0A@$02$02@Eigen@@@Eigen@@QEAAAEAV?$Matrix@N$02$02$0A@$02$02@2@_J0@Z) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: class Eigen::Matrix<double,3,1,0,3,1> & __cdecl Eigen::DenseBase<class Eigen::Matrix<double,3,1,0,3,1> >::setZero(void)" (?setZero@?$DenseBase@V?$Matrix@N$02$00$0A@$02$00@Eigen@@@Eigen@@QEAAAEAV?$Matrix@N$02$00$0A@$02$00@2@XZ) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: class Eigen::Matrix<double,3,3,0,3,3> & __cdecl Eigen::DenseBase<class Eigen::Matrix<double,3,3,0,3,3> >::setZero(void)" (?setZero@?$DenseBase@V?$Matrix@N$02$02$0A@$02$02@Eigen@@@Eigen@@QEAAAEAV?$Matrix@N$02$02$0A@$02$02@2@XZ) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: __int64 __cdecl Eigen::EigenBase<class Eigen::Matrix<double,3,1,0,3,1> >::size(void)const " (?size@?$EigenBase@V?$Matrix@N$02$00$0A@$02$00@Eigen@@@Eigen@@QEBA_JXZ) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: __int64 __cdecl Eigen::EigenBase<class Eigen::Matrix<double,3,3,0,3,3> >::size(void)const " (?size@?$EigenBase@V?$Matrix@N$02$02$0A@$02$02@Eigen@@@Eigen@@QEBA_JXZ) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: class Eigen::VectorBlock<class Eigen::Matrix<double,3,1,0,3,1>,-1> __cdecl Eigen::DenseBase<class Eigen::Matrix<double,3,1,0,3,1> >::tail(__int64)" (?tail@?$DenseBase@V?$Matrix@N$02$00$0A@$02$00@Eigen@@@Eigen@@QEAA?AV?$VectorBlock@V?$Matrix@N$02$00$0A@$02$00@Eigen@@$0?0@2@_J@Z) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: class Eigen::Transpose<class Eigen::Matrix<double,3,1,0,3,1> > __cdecl Eigen::DenseBase<class Eigen::Matrix<double,3,1,0,3,1> >::transpose(void)" (?transpose@?$DenseBase@V?$Matrix@N$02$00$0A@$02$00@Eigen@@@Eigen@@QEAA?AV?$Transpose@V?$Matrix@N$02$00$0A@$02$00@Eigen@@@2@XZ) already defined in gtsam.lib(gtsam.dll)
    1>PointCloudLocalization.obj : error LNK2005: "public: class Eigen::Transpose<class Eigen::Matrix<double,3,3,0,3,3> > __cdecl Eigen::DenseBase<class Eigen::Matrix<double,3,3,0,3,3> >::transpose(void)" (?transpose@?$DenseBase@V?$Matrix@N$02$02$0A@$02$02@Eigen@@@Eigen@@QEAA?AV?$Transpose@V?$Matrix@N$02$02$0A@$02$02@Eigen@@@2@XZ) already defined in gtsam.lib(gtsam.dll)
    1>../bin\bslam.exe : fatal error LNK1169: one or more multiply defined symbols found
    

    Is this a gtsam and PCL issue? Have you seen this before?

    Thanks again!

  3. Ben reporter

    ... I have tried this with system eigen in PCL, and have just rebuilt PCL and gtsam to use the gtsam modified Eigen. I get the same error! Any help would be much appreciated. Thanks again.

  4. Jing Dong

    Hi @antithing have you tried static lib for both gtsam and PCL? Using static lib might avoid this linking issue, but I'm not sure since I have not seen this error before

  5. Frank Dellaert

    Does this now work? If so, could you do a PR on the README and/or INSTALL to clarify what works? Many of us don't have windows machines so that would be helpful for others.

  6. Log in to comment