Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Eigen library : compile error

Eigen library : compile error

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++htmltutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    includeh10
    wrote on last edited by
    #1

    Following code is at very beginning of "HessenbergDecomposition.h", which is a public library for calculating Eigen values. Source code cab be viewed at this link.

    namespace Eigen
    {
    namespace internal
    {
    template struct HessenbergDecompositionMatrixHReturnType;
    template struct traits > //line 21
    { //line 22
    typedef MatrixType ReturnType;
    };
    }
    //more code
    }

    VC++ compiler says:

    E:\...\Eigen/HessenbergDecomposition.h(21) : error C2143: syntax error : missing ';' before '<'
    E:\...\Eigen/HessenbergDecomposition.h(21) : error C2059: syntax error : '<'
    E:\...\Eigen/HessenbergDecomposition.h(21) : error C2065: 'MatrixType' : undeclared identifier
    E:\...\Eigen/HessenbergDecomposition.h(22) : error C2143: syntax error : missing ';' before '{'
    E:\...\Eigen/HessenbergDecomposition.h(22) : error C2447: missing function header (old-style formal list?)

    Is this c/c++ or UNIX/VC++ incompatible problem? How to fix the compile error? Thanks for code corrections.

    L C 2 Replies Last reply
    0
    • I includeh10

      Following code is at very beginning of "HessenbergDecomposition.h", which is a public library for calculating Eigen values. Source code cab be viewed at this link.

      namespace Eigen
      {
      namespace internal
      {
      template struct HessenbergDecompositionMatrixHReturnType;
      template struct traits > //line 21
      { //line 22
      typedef MatrixType ReturnType;
      };
      }
      //more code
      }

      VC++ compiler says:

      E:\...\Eigen/HessenbergDecomposition.h(21) : error C2143: syntax error : missing ';' before '<'
      E:\...\Eigen/HessenbergDecomposition.h(21) : error C2059: syntax error : '<'
      E:\...\Eigen/HessenbergDecomposition.h(21) : error C2065: 'MatrixType' : undeclared identifier
      E:\...\Eigen/HessenbergDecomposition.h(22) : error C2143: syntax error : missing ';' before '{'
      E:\...\Eigen/HessenbergDecomposition.h(22) : error C2447: missing function header (old-style formal list?)

      Is this c/c++ or UNIX/VC++ incompatible problem? How to fix the compile error? Thanks for code corrections.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I don't think you can use that syntax on a struct definition[^].

      1 Reply Last reply
      0
      • I includeh10

        Following code is at very beginning of "HessenbergDecomposition.h", which is a public library for calculating Eigen values. Source code cab be viewed at this link.

        namespace Eigen
        {
        namespace internal
        {
        template struct HessenbergDecompositionMatrixHReturnType;
        template struct traits > //line 21
        { //line 22
        typedef MatrixType ReturnType;
        };
        }
        //more code
        }

        VC++ compiler says:

        E:\...\Eigen/HessenbergDecomposition.h(21) : error C2143: syntax error : missing ';' before '<'
        E:\...\Eigen/HessenbergDecomposition.h(21) : error C2059: syntax error : '<'
        E:\...\Eigen/HessenbergDecomposition.h(21) : error C2065: 'MatrixType' : undeclared identifier
        E:\...\Eigen/HessenbergDecomposition.h(22) : error C2143: syntax error : missing ';' before '{'
        E:\...\Eigen/HessenbergDecomposition.h(22) : error C2447: missing function header (old-style formal list?)

        Is this c/c++ or UNIX/VC++ incompatible problem? How to fix the compile error? Thanks for code corrections.

        C Offline
        C Offline
        CubbiMew
        wrote on last edited by
        #3

        The code is correct C++, except that this header file will only compile if included after Core, as it is in Eigenvalues:

        #ifndef EIGEN_EIGENVALUES_MODULE_H
        #define EIGEN_EIGENVALUES_MODULE_H

        #include "Core"
        ...
        #include "src/Eigenvalues/HessenbergDecomposition.h"

        src/Eigenvalues/HessenbergDecomposition.h is not supposed to be included directly. What is the cpp file that you're trying to compile?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups