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 #7

Open
celeritasracing opened this issue Aug 27, 2019 · 3 comments
Open

Compilation Error #7

celeritasracing opened this issue Aug 27, 2019 · 3 comments

Comments

@celeritasracing
Copy link

I'm getting the follow error when compiling the code.

KalmanTest.cpp:(.text+0x71e): undefined reference to KalmanFilter::KalmanFilter(double, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&)' /usr/bin/ld: KalmanTest.cpp:(.text+0x837): undefined reference to KalmanFilter::init(double, Eigen::Matrix<double, -1, 1, 0, -1, 1> const&)'
/usr/bin/ld: KalmanTest.cpp:(.text+0x9b0): undefined reference to `KalmanFilter::update(Eigen::Matrix<double, -1, 1, 0, -1, 1> const&)'
collect2: error: ld returned 1 exit status

@VbsmRobotic
Copy link

Hi, I also getting the same error is there any solution for it?

@VbsmRobotic
Copy link

: /usr/local/include/eigen3/Eigen/src/Core/Product.h:97: Eigen::Product<Lhs, Rhs, Option>::Product(const Lhs&, const Rhs&) [with _Lhs = Eigen::Matrix<double, -1, -1>; _Rhs = Eigen::Matrix<double, -1, -1>; int Option = 0; Eigen::Product<Lhs, Rhs, Option>::Lhs = Eigen::Matrix<double, -1, -1>; Eigen::Product<Lhs, Rhs, Option>::Rhs = Eigen::Matrix<double, -1, -1>]: Assertion `lhs.cols() == rhs.rows() && "invalid matrix product" && "if you wanted a coeff-wise or a dot product use the respective explicit functions"' failed.

@mechandansinha
Copy link

mechandansinha commented Sep 2, 2022

That's because you are only trying to compile the kalman-test.cpp file which references kalman.cpp implicitly. If you carefully look through the CMakeLists.txt file (which also needs modifications btw), in the line set(SOURCE_FILES kalman.cpp kalman-test.cpp) we notice that both of these are to be compiled simultaneously in order to run the test-case presented in kalman-test file. So if you are not using CMake for compilation, just use the command g++ kalman.cpp kalman-test.cpp, then run ./a.exe which will give the estimated state vector at each time step and a host of other things.

This closes #7 (comment)

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