Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error:‘csc’ has not been declared #135

Closed
ubgaokk opened this issue Jun 13, 2023 · 6 comments
Closed

Compilation error:‘csc’ has not been declared #135

ubgaokk opened this issue Jun 13, 2023 · 6 comments

Comments

@ubgaokk
Copy link

ubgaokk commented Jun 13, 2023

When I compiled osqp-eigen after installing osqp and Eigen3, I encounter the following error:
By the way, I have tried two machine with ubuntu 20.04. Both of them has the same error as follows.

~/Downloads/osqp-eigen/build$ make
Scanning dependencies of target OsqpEigen
[ 20%] Building CXX object CMakeFiles/OsqpEigen.dir/src/Data.cpp.o
In file included from /home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:18:0,
                 from /home/kanke/Downloads/osqp-eigen/src/Data.cpp:12:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.hpp:42:37: error: ‘csc’ has not been declared
                                     csc*& osqpSparseMatrix);
                                     ^~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.hpp:51:56: error: ‘csc’ does not name a type; did you mean ‘cosl’?
         bool osqpSparseMatrixToEigenSparseMatrix(const csc* const & osqpSparseMatrix,
                                                        ^~~
                                                        cosl
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.hpp:61:47: error: ‘csc’ does not name a type; did you mean ‘cosl’?
         bool osqpSparseMatrixToTriplets(const csc* const & osqpSparseMatrix,
                                               ^~~
                                               cosl
In file included from /home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.hpp:76:0,
                 from /home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:18,
                 from /home/kanke/Downloads/osqp-eigen/src/Data.cpp:12:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:12:62: error: ‘csc’ has not been declared
                                                              csc*& osqpSparseMatrix)
                                                              ^~~
In file included from /home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.hpp:76:0,
                 from /home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:18,
                 from /home/kanke/Downloads/osqp-eigen/src/Data.cpp:12:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp: In function ‘bool OsqpEigen::SparseMatrixHelper::createOsqpSparseMatrix(const Eigen::SparseCompressedBase<Derived>&, int*&)’:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:18:5: error: ‘c_int’ was not declared in this scope
     c_int rows = colMajorCopy.rows();
     ^~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:18:5: note: suggested alternative: ‘u_int’
     c_int rows = colMajorCopy.rows();
     ^~~~~
     u_int
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:19:11: error: expected ‘;’ before ‘cols’
     c_int cols = colMajorCopy.cols();
           ^~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:20:11: error: expected ‘;’ before ‘numberOfNonZeroCoeff’
     c_int numberOfNonZeroCoeff = colMajorCopy.nonZeros();
           ^~~~~~~~~~~~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:34:36: error: ‘rows’ was not declared in this scope
     osqpSparseMatrix = csc_spalloc(rows, cols, numberOfNonZeroCoeff, 1, 0);
                                    ^~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:34:36: note: suggested alternative: ‘powh’
     osqpSparseMatrix = csc_spalloc(rows, cols, numberOfNonZeroCoeff, 1, 0);
                                    ^~~~
                                    powh
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:34:42: error: ‘cols’ was not declared in this scope
     osqpSparseMatrix = csc_spalloc(rows, cols, numberOfNonZeroCoeff, 1, 0);
                                          ^~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:34:42: note: suggested alternative: ‘cos’
     osqpSparseMatrix = csc_spalloc(rows, cols, numberOfNonZeroCoeff, 1, 0);
                                          ^~~~
                                          cos
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:34:48: error: ‘numberOfNonZeroCoeff’ was not declared in this scope
     osqpSparseMatrix = csc_spalloc(rows, cols, numberOfNonZeroCoeff, 1, 0);
                                                ^~~~~~~~~~~~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:34:24: error: there are no arguments to ‘csc_spalloc’ that depend on a template parameter, so a declaration of ‘csc_spalloc’ must be available [-fpermissive]
     osqpSparseMatrix = csc_spalloc(rows, cols, numberOfNonZeroCoeff, 1, 0);
                        ^~~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:34:24: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:39:31: error: request for member ‘p’ in ‘osqpSparseMatrix->’, which is of non-class type ‘int’
             osqpSparseMatrix->p[k] = static_cast<c_int>(outerIndexPtr[k]);
                               ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:39:50: error: ‘c_int’ does not name a type; did you mean ‘u_int’?
             osqpSparseMatrix->p[k] = static_cast<c_int>(outerIndexPtr[k]);
                                                  ^~~~~
                                                  u_int
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:42:35: error: request for member ‘p’ in ‘osqpSparseMatrix->’, which is of non-class type ‘int’
                 osqpSparseMatrix->p[k] = 0;
                                   ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:44:35: error: request for member ‘p’ in ‘osqpSparseMatrix->’, which is of non-class type ‘int’
                 osqpSparseMatrix->p[k] = osqpSparseMatrix->p[k-1] + innerNonZerosPtr[k-1];
                                   ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:44:60: error: request for member ‘p’ in ‘osqpSparseMatrix->’, which is of non-class type ‘int’
                 osqpSparseMatrix->p[k] = osqpSparseMatrix->p[k-1] + innerNonZerosPtr[k-1];
                                                            ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:48:31: error: request for member ‘i’ in ‘osqpSparseMatrix->’, which is of non-class type ‘int’
             osqpSparseMatrix->i[innerOsqpPosition] = static_cast<c_int>(it.row());
                               ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:48:66: error: ‘c_int’ does not name a type; did you mean ‘u_int’?
             osqpSparseMatrix->i[innerOsqpPosition] = static_cast<c_int>(it.row());
                                                                  ^~~~~
                                                                  u_int
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:49:31: error: request for member ‘x’ in ‘osqpSparseMatrix->’, which is of non-class type ‘int’
             osqpSparseMatrix->x[innerOsqpPosition] = static_cast<c_float>(it.value());
                               ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:49:66: error: ‘c_float’ does not name a type; did you mean ‘float’?
             osqpSparseMatrix->x[innerOsqpPosition] = static_cast<c_float>(it.value());
                                                                  ^~~~~~~
                                                                  float
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:53:23: error: request for member ‘p’ in ‘osqpSparseMatrix->’, which is of non-class type ‘int’
     osqpSparseMatrix->p[static_cast<int>(cols)] = static_cast<c_int>(innerOsqpPosition);
                       ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:53:63: error: ‘c_int’ does not name a type; did you mean ‘u_int’?
     osqpSparseMatrix->p[static_cast<int>(cols)] = static_cast<c_int>(innerOsqpPosition);
                                                               ^~~~~
                                                               u_int
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp: At global scope:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:61:70: error: ‘csc’ does not name a type; did you mean ‘cosl’?
 ool OsqpEigen::SparseMatrixHelper::osqpSparseMatrixToTriplets(const csc* const & osqpSparseMatrix,
                                                                     ^~~
                                                                      cosl
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp: In function ‘bool OsqpEigen::SparseMatrixHelper::osqpSparseMatrixToTriplets(const int* const&, std::vector<Eigen::Triplet<T> >&)’:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:72:5: error: ‘c_int’ was not declared in this scope
     c_int* innerIndexPtr = osqpSparseMatrix->i;
     ^~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:72:5: note: suggested alternative: ‘u_int’
     c_int* innerIndexPtr = osqpSparseMatrix->i;
     ^~~~~
     u_int
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:72:12: error: ‘innerIndexPtr’ was not declared in this scope
     c_int* innerIndexPtr = osqpSparseMatrix->i;
            ^~~~~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:72:46: error: request for member ‘i’ in ‘osqpSparseMatrix->’, which is of non-class type ‘const int’
     c_int* innerIndexPtr = osqpSparseMatrix->i;
                                              ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:73:12: error: ‘outerIndexPtr’ was not declared in this scope
     c_int* outerIndexPtr = osqpSparseMatrix->p;
            ^~~~~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:73:46: error: request for member ‘p’ in ‘osqpSparseMatrix->’, which is of non-class type ‘const int’
     c_int* outerIndexPtr = osqpSparseMatrix->p;
                                              ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:76:5: error: ‘c_float’ was not declared in this scope
     c_float* valuePtr = osqpSparseMatrix->x;
     ^~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:76:5: note: suggested alternative: ‘float’
     c_float* valuePtr = osqpSparseMatrix->x;
     ^~~~~~~
     float
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:76:14: error: ‘valuePtr’ was not declared in this scope
     c_float* valuePtr = osqpSparseMatrix->x;
              ^~~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:76:43: error: request for member ‘x’ in ‘osqpSparseMatrix->’, which is of non-class type ‘const int’
     c_float* valuePtr = osqpSparseMatrix->x;
                                           ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:77:11: error: expected ‘;’ before ‘numberOfNonZeroCoeff’
     c_int numberOfNonZeroCoeff =  osqpSparseMatrix->p[osqpSparseMatrix->n];
           ^~~~~~~~~~~~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:82:13: error: expected ‘;’ before ‘value’
     c_float value;
             ^~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:84:24: error: ‘numberOfNonZeroCoeff’ was not declared in this scope
     tripletList.resize(numberOfNonZeroCoeff);
                        ^~~~~~~~~~~~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:87:9: error: ‘value’ was not declared in this scope
         value = valuePtr[i];
         ^~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:87:9: note: suggested alternative: ‘valloc’
         value = valuePtr[i];
         ^~~~~
         valloc
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp: At global scope:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:101:79: error: ‘csc’ does not name a type; did you mean ‘cosl’?
 igen::SparseMatrixHelper::osqpSparseMatrixToEigenSparseMatrix(const csc* const & osqpSparseMatrix,
                                                                     ^~~
                                                                               cosl
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp: In function ‘bool OsqpEigen::SparseMatrixHelper::osqpSparseMatrixToEigenSparseMatrix(const int* const&, Eigen::SparseMatrix<Scalar>&)’:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:112:34: error: request for member ‘m’ in ‘osqpSparseMatrix->’, which is of non-class type ‘const int’
     int rows = osqpSparseMatrix->m;
                                  ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/SparseMatrixHelper.tpp:113:34: error: request for member ‘n’ in ‘osqpSparseMatrix->’, which is of non-class type ‘const int’
     int cols = osqpSparseMatrix->n;
                                  ^
In file included from /home/kanke/Downloads/osqp-eigen/src/Data.cpp:12:0:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp: At global scope:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:30:9: error: ‘OSQPData’ does not name a type; did you mean ‘OSQPInt’?
         OSQPData *m_data; /**< OSQPData struct. */
         ^~~~~~~~
         OSQPInt
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:96:51: error: ‘c_float’ was not declared in this scope
         bool setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradientVector);
                                                   ^~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:96:51: note: suggested alternative: ‘float’
         bool setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradientVector);
                                                   ^~~~~~~
                                                   float
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:96:76: error: template argument 1 is invalid
  bool setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradientVector);
                                                                     ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:96:77: error: template argument 1 is invalid
 bool setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradientVector);
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:96:77: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:98:23: error: ‘c_float’ was not declared in this scope
         Eigen::Matrix<c_float, Eigen::Dynamic, 1> getGradient();
                       ^~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:98:23: note: suggested alternative: ‘float’
         Eigen::Matrix<c_float, Eigen::Dynamic, 1> getGradient();
                       ^~~~~~~
                       float
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:98:49: error: template argument 1 is invalid
         Eigen::Matrix<c_float, Eigen::Dynamic, 1> getGradient();
                                                 ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:116:53: error: ‘c_float’ was not declared in this scope
         bool setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBoundVector);
                                                     ^~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:116:53: note: suggested alternative: ‘float’
         bool setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBoundVector);
                                                     ^~~~~~~
                                                     float
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:116:78: error: template argument 1 is invalid
 ool setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBoundVector);
                                                                     ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:116:79: error: template argument 1 is invalid
 ol setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBoundVector);
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:116:79: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:126:53: error: ‘c_float’ was not declared in this scope
         bool setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBoundVector);
                                                     ^~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:126:53: note: suggested alternative: ‘float’
         bool setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBoundVector);
                                                     ^~~~~~~
                                                     float
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:126:78: error: template argument 1 is invalid
 ool setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBoundVector);
                                                                     ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:126:79: error: template argument 1 is invalid
 ol setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBoundVector);
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:126:79: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:137:49: error: ‘c_float’ was not declared in this scope
         bool setBounds(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound,
                                                 ^~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:137:49: note: suggested alternative: ‘float’
         bool setBounds(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound,
                                                 ^~~~~~~
                                                 float
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:137:74: error: template argument 1 is invalid
    bool setBounds(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound,
                                                                     ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:137:75: error: template argument 1 is invalid
   bool setBounds(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound,
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:137:75: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:138:49: error: ‘c_float’ was not declared in this scope
                        Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound);
                                                 ^~~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:138:49: note: suggested alternative: ‘float’
                        Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound);
                                                 ^~~~~~~
                                                 float
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:138:74: error: template argument 1 is invalid
                   Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound);
                                                                     ^
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:138:75: error: template argument 1 is invalid
                  Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound);
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:138:75: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:144:9: error: ‘OSQPData’ does not name a type; did you mean ‘OSQPInt’?
         OSQPData *const & getData() const;
         ^~~~~~~~
         OSQPInt
In file included from /home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:154:0,
                 from /home/kanke/Downloads/osqp-eigen/src/Data.cpp:12:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp: In member function ‘bool OsqpEigen::Data::setHessianMatrix(const Eigen::SparseCompressedBase<Derived>&)’:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp:30:34: error: ‘m_data’ was not declared in this scope
     if ((hessianMatrix.rows() != m_data->n) || (hessianMatrix.cols()!= m_data->n)){
                                  ^~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp:30:34: note: suggested alternative: ‘Data’
     if ((hessianMatrix.rows() != m_data->n) || (hessianMatrix.cols()!= m_data->n)){
                                  ^~~~~~
                                  Data
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp:39:93: error: ‘m_data’ was not declared in this scope
 eMatrixHelper::createOsqpSparseMatrix(hessianMatrixUpperTriangular, m_data->P)){
                                                                     ^~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp:39:93: note: suggested alternative: ‘Data’
 eMatrixHelper::createOsqpSparseMatrix(hessianMatrixUpperTriangular, m_data->P)){
                                                                     ^~~~~~
                                                                                             Data
In file included from /home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.hpp:154:0,
                 from /home/kanke/Downloads/osqp-eigen/src/Data.cpp:12:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp: In member function ‘bool OsqpEigen::Data::setLinearConstraintsMatrix(const Eigen::SparseCompressedBase<Derived>&)’:
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp:70:44: error: ‘m_data’ was not declared in this scope
     if ((linearConstraintsMatrix.rows() != m_data->m) || (linearConstraintsMatrix.cols()!= m_data->n)){
                                            ^~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp:70:44: note: suggested alternative: ‘Data’
     if ((linearConstraintsMatrix.rows() != m_data->m) || (linearConstraintsMatrix.cols()!= m_data->n)){
                                            ^~~~~~
                                            Data
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp:78:65: error: ‘m_data’ was not declared in this scope
                                                                 m_data->A)){
                                                                 ^~~~~~
/home/kanke/Downloads/osqp-eigen/include/OsqpEigen/Data.tpp:78:65: note: suggested alternative: ‘Data’
                                                                 m_data->A)){
                                                                 ^~~~~~
                                                                 Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In constructor ‘OsqpEigen::Data::Data()’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:24:5: error: ‘m_data’ was not declared in this scope
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
     ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:24:5: note: suggested alternative: ‘Data’
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
     ^~~~~~
     Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:24:15: error: ‘OSQPData’ was not declared in this scope
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
               ^~~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:24:15: note: suggested alternative: ‘OSQPInt’
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
               ^~~~~~~~
               OSQPInt
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:24:25: error: expected primary-expression before ‘)’ token
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
                         ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In constructor ‘OsqpEigen::Data::Data(int, int)’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:38:5: error: ‘m_data’ was not declared in this scope
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
     ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:38:5: note: suggested alternative: ‘Data’
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
     ^~~~~~
     Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:38:15: error: ‘OSQPData’ was not declared in this scope
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
               ^~~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:38:15: note: suggested alternative: ‘OSQPInt’
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
               ^~~~~~~~
               OSQPInt
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:38:25: error: expected primary-expression before ‘)’ token
     m_data = (OSQPData *)c_malloc(sizeof(OSQPData));
                         ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘void OsqpEigen::Data::clearHessianMatrix()’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:50:20: error: ‘m_data’ was not declared in this scope
         csc_spfree(m_data->P);
                    ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:50:20: note: suggested alternative: ‘Data’
         csc_spfree(m_data->P);
                    ^~~~~~
                    Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:50:9: error: ‘csc_spfree’ was not declared in this scope
         csc_spfree(m_data->P);
         ^~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘void OsqpEigen::Data::clearLinearConstraintsMatrix()’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:59:20: error: ‘m_data’ was not declared in this scope
         csc_spfree(m_data->A);
                    ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:59:20: note: suggested alternative: ‘Data’
         csc_spfree(m_data->A);
                    ^~~~~~
                    Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:59:9: error: ‘csc_spfree’ was not declared in this scope
         csc_spfree(m_data->A);
         ^~~~~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In destructor ‘OsqpEigen::Data::~Data()’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:68:12: error: ‘m_data’ was not declared in this scope
     c_free(m_data);
            ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:68:12: note: suggested alternative: ‘Data’
     c_free(m_data);
            ^~~~~~
            Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:68:5: error: ‘c_free’ was not declared in this scope
     c_free(m_data);
     ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:68:5: note: suggested alternative: ‘free’
     c_free(m_data);
     ^~~~~~
     free
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘void OsqpEigen::Data::setNumberOfVariables(int)’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:74:5: error: ‘m_data’ was not declared in this scope
     m_data->n = n;
     ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:74:5: note: suggested alternative: ‘Data’
     m_data->n = n;
     ^~~~~~
     Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘void OsqpEigen::Data::setNumberOfConstraints(int)’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:80:5: error: ‘m_data’ was not declared in this scope
     m_data->m = m;
     ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:80:5: note: suggested alternative: ‘Data’
     m_data->m = m;
     ^~~~~~
     Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: At global scope:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:83:1: error: ‘OSQPData’ does not name a type; did you mean ‘OSQPInt’?
 OSQPData* const & OsqpEigen::Data::getData() const
 ^~~~~~~~
 OSQPInt
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘bool OsqpEigen::Data::isSet() const’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:90:36: error: ‘m_data’ was not declared in this scope
     const bool areConstraintsOk = (m_data->m == 0) ||
                                    ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:90:36: note: suggested alternative: ‘Data’
     const bool areConstraintsOk = (m_data->m == 0) ||
                                    ^~~~~~
                                    Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: At global scope:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:102:60: error: ‘c_float’ was not declared in this scope
 bool OsqpEigen::Data::setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradient)
                                                            ^~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:102:60: note: suggested alternative: ‘float’
 bool OsqpEigen::Data::setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradient)
                                                            ^~~~~~~
                                                            float
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:102:85: error: template argument 1 is invalid
 Data::setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradient)
                                                                     ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:102:86: error: template argument 1 is invalid
 ata::setGradient(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> gradient)
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:102:86: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘bool OsqpEigen::Data::setGradient(int)’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:104:17: error: request for member ‘rows’ in ‘gradient’, which is of non-class type ‘int’
     if(gradient.rows() != m_data->n){
                 ^~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:104:27: error: ‘m_data’ was not declared in this scope
     if(gradient.rows() != m_data->n){
                           ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:104:27: note: suggested alternative: ‘Data’
     if(gradient.rows() != m_data->n){
                           ^~~~~~
                           Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:110:5: error: ‘m_data’ was not declared in this scope
     m_data->q = gradient.data();
     ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:110:5: note: suggested alternative: ‘Data’
     m_data->q = gradient.data();
     ^~~~~~
     Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:110:26: error: request for member ‘data’ in ‘gradient’, which is of non-class type ‘int’
     m_data->q = gradient.data();
                          ^~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: At global scope:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:114:15: error: ‘c_float’ was not declared in this scope
 Eigen::Matrix<c_float, Eigen::Dynamic, 1> OsqpEigen::Data::getGradient()
               ^~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:114:15: note: suggested alternative: ‘float’
 Eigen::Matrix<c_float, Eigen::Dynamic, 1> OsqpEigen::Data::getGradient()
               ^~~~~~~
               float
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:114:41: error: template argument 1 is invalid
 Eigen::Matrix<c_float, Eigen::Dynamic, 1> OsqpEigen::Data::getGradient()
                                         ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘int OsqpEigen::Data::getGradient()’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:116:37: error: ‘c_float’ was not declared in this scope
     return Eigen::Map<Eigen::Matrix<c_float, Eigen::Dynamic, 1>>(m_data->q, m_data->n);
                                     ^~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:116:37: note: suggested alternative: ‘float’
     return Eigen::Map<Eigen::Matrix<c_float, Eigen::Dynamic, 1>>(m_data->q, m_data->n);
                                     ^~~~~~~
                                     float
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:116:62: error: template argument 1 is invalid
     return Eigen::Map<Eigen::Matrix<c_float, Eigen::Dynamic, 1>>(m_data->q, m_data->n);
                                                              ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:116:63: error: template argument 1 is invalid
     return Eigen::Map<Eigen::Matrix<c_float, Eigen::Dynamic, 1>>(m_data->q, m_data->n);
                                                               ^~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:116:66: error: ‘m_data’ was not declared in this scope
     return Eigen::Map<Eigen::Matrix<c_float, Eigen::Dynamic, 1>>(m_data->q, m_data->n);
                                                                  ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:116:66: note: suggested alternative: ‘Data’
     return Eigen::Map<Eigen::Matrix<c_float, Eigen::Dynamic, 1>>(m_data->q, m_data->n);
                                                                  ^~~~~~
                                                                  Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: At global scope:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:119:62: error: ‘c_float’ was not declared in this scope
 bool OsqpEigen::Data::setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound)
                                                              ^~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:119:62: note: suggested alternative: ‘float’
 bool OsqpEigen::Data::setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound)
                                                              ^~~~~~~
                                                              float
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:119:87: error: template argument 1 is invalid
 ta::setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound)
                                                                     ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:119:88: error: template argument 1 is invalid
 a::setLowerBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound)
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:119:88: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘bool OsqpEigen::Data::setLowerBound(int)’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:121:19: error: request for member ‘rows’ in ‘lowerBound’, which is of non-class type ‘int’
     if(lowerBound.rows() != m_data->m){
                   ^~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:121:29: error: ‘m_data’ was not declared in this scope
     if(lowerBound.rows() != m_data->m){
                             ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:121:29: note: suggested alternative: ‘Data’
     if(lowerBound.rows() != m_data->m){
                             ^~~~~~
                             Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:127:5: error: ‘m_data’ was not declared in this scope
     m_data->l = lowerBound.data();
     ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:127:5: note: suggested alternative: ‘Data’
     m_data->l = lowerBound.data();
     ^~~~~~
     Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:127:28: error: request for member ‘data’ in ‘lowerBound’, which is of non-class type ‘int’
     m_data->l = lowerBound.data();
                            ^~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: At global scope:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:131:62: error: ‘c_float’ was not declared in this scope
 bool OsqpEigen::Data::setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound)
                                                              ^~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:131:62: note: suggested alternative: ‘float’
 bool OsqpEigen::Data::setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound)
                                                              ^~~~~~~
                                                              float
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:131:87: error: template argument 1 is invalid
 ta::setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound)
                                                                     ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:131:88: error: template argument 1 is invalid
 a::setUpperBound(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound)
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:131:88: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: In member function ‘bool OsqpEigen::Data::setUpperBound(int)’:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:133:19: error: request for member ‘rows’ in ‘upperBound’, which is of non-class type ‘int’
     if(upperBound.rows() != m_data->m){
                   ^~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:133:29: error: ‘m_data’ was not declared in this scope
     if(upperBound.rows() != m_data->m){
                             ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:133:29: note: suggested alternative: ‘Data’
     if(upperBound.rows() != m_data->m){
                             ^~~~~~
                             Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:139:5: error: ‘m_data’ was not declared in this scope
     m_data->u = upperBound.data();
     ^~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:139:5: note: suggested alternative: ‘Data’
     m_data->u = upperBound.data();
     ^~~~~~
     Data
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:139:28: error: request for member ‘data’ in ‘upperBound’, which is of non-class type ‘int’
     m_data->u = upperBound.data();
                            ^~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp: At global scope:
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:143:58: error: ‘c_float’ was not declared in this scope
 bool OsqpEigen::Data::setBounds(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound,
                                                          ^~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:143:58: note: suggested alternative: ‘float’
 bool OsqpEigen::Data::setBounds(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound,
                                                          ^~~~~~~
                                                          float
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:143:83: error: template argument 1 is invalid
 ::Data::setBounds(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound,
                                                                     ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:143:84: error: template argument 1 is invalid
 :Data::setBounds(Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> lowerBound,
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:143:84: error: template argument 3 is invalid
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:144:58: error: ‘c_float’ was not declared in this scope
                                 Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound)
                                                          ^~~~~~~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:144:58: note: suggested alternative: ‘float’
                                 Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound)
                                                          ^~~~~~~
                                                          float
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:144:83: error: template argument 1 is invalid
                   Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound)
                                                                     ^
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:144:84: error: template argument 1 is invalid
                  Eigen::Ref<Eigen::Matrix<c_float, Eigen::Dynamic, 1>> upperBound)
                                                                     ^~
/home/kanke/Downloads/osqp-eigen/src/Data.cpp:144:84: error: template argument 3 is invalid
CMakeFiles/OsqpEigen.dir/build.make:81: recipe for target 'CMakeFiles/OsqpEigen.dir/src/Data.cpp.o' failed
make[2]: *** [CMakeFiles/OsqpEigen.dir/src/Data.cpp.o] Error 1
CMakeFiles/Makefile2:142: recipe for target 'CMakeFiles/OsqpEigen.dir/all' failed
make[1]: *** [CMakeFiles/OsqpEigen.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
@traversaro
Copy link
Member

Which version of osqp are you compiling against?

@ubgaokk
Copy link
Author

ubgaokk commented Jun 14, 2023

I compiled the current master branch of osqp github
https://github.com/osqp/osqp
Everything of osqp goes smoothly.

@traversaro
Copy link
Member

Can you try to use osqp 0.6.3 ? At the moment compatibility with latest osqp is work in progress, see #131 .

@BorisVandermeer
Copy link

osqp.zip
This OSQP source works fine with this repo.
OSQP repo changes a lot recently ...

@traversaro
Copy link
Member

I think also v0.6.3 should work fine, for the changes necessary for osqp master see #131 .

@ubgaokk
Copy link
Author

ubgaokk commented Jun 16, 2023

Thanks, @traversaro and @BorisVandermeer . I have tried v0.6.3 OSQP, it works well now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants