main.cc中的代码是:
#include <Eigen/Sparse>
#include <unsupported/Eigen/ArpackSupport>
int main()
{
...
Eigen::ArpackGeneralizedSelfAdjointEigenSolver<Eigen::SparseMatrix<double>> solver;
solver.compute(...);
...
}
以下命令
c++ -I /path/to/eigen -std=c++17 main.cc
导致以下错误:
Undefined symbols for architecture x86_64:
"_dsaupd_", referenced from:
Eigen::internal::arpack_wrapper<double, double>::saupd(int*, char*, int*, char*, int*, double*, double*, int*, double*, int*, int*, int*, double*, double*, int*, int*) in arpack-946df6.o
"_dseupd_", referenced from:
Eigen::internal::arpack_wrapper<double, double>::seupd(int*, char*, int*, double*, double*, int*, double*, char*, int*, char*, int*, double*, double*, int*, double*, int*, int*, int*, double*, double*, int*, int*) in arpack-946df6.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
问题出在哪里,如何解决?