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

编译错误问题 #2

Open
Jas0nG opened this issue Aug 15, 2023 · 1 comment
Open

编译错误问题 #2

Jas0nG opened this issue Aug 15, 2023 · 1 comment

Comments

@Jas0nG
Copy link

Jas0nG commented Aug 15, 2023

Subject

编译时存在未声明的变量,错误信息如下:

In file included from /home/wtc/Project/EigenChineseDocument/Eigen/chapter3_test.cpp:1:
~/Project/EigenChineseDocument/Eigen/Chapter3_SparseLinearAlgebra/Section1_SparseMatrixManipulations.hpp: In function ‘void Chapter3_SparseLinearAlgebra::Section1_SparseMatrixManipulations::TheSparseMatrixClass()’:
~Project/EigenChineseDocument/Eigen/Chapter3_SparseLinearAlgebra/Section1_SparseMatrixManipulations.hpp:133:42: error: ‘rows’ was not declared in this scope
  133 |                 SparseMatrix<double> mat(rows, cols);
      |                                          ^~~~
~/Project/EigenChineseDocument/Eigen/Chapter3_SparseLinearAlgebra/Section1_SparseMatrixManipulations.hpp:133:48: error: ‘cols’ was not declared in this scope; did you mean ‘cosl’?
  133 |                 SparseMatrix<double> mat(rows, cols);
      |                                                ^~~~
      |                                                cosl
make[2]: *** [CMakeFiles/chapter3_test.dir/build.make:76: CMakeFiles/chapter3_test.dir/chapter3_test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/chapter3_test.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

看起来是文档中的伪代码部分被错误地复制为了可运行的代码部分。我稍后会提一个PR解决这个问题。

我的环境

  • Ubuntu 20.04
  • Eigen 3.3.7
@Jas0nG
Copy link
Author

Jas0nG commented Aug 15, 2023

麻烦在PR合入后关闭该Issue #3

@Jas0nG Jas0nG reopened this Aug 15, 2023
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

1 participant