1

I try to adapt the function to create a function to compute the RMSE of my Kalman filter (you don't need to know what it is it in order to help me).

The signature, and some basic informations regarding this function (which is in a file called tools.cpp) is the following:

#include <iostream>
#include "tools.h"

Tools::Tools() {}

Tools::~Tools() {}

VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations, const vector<VectorXd> &ground_truth) {
}

I am trying to call this function from my main.cpp (only important parts):

#include <iostream>
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include <vector>
#include "Eigen/Dense"
#include "ukf.h"
#include "measurement_package.h"
#include "ground_truth_package.h"

vector<VectorXd> estimations;
vector<VectorXd> ground_truth;
estimations.push_back(ukf.x_);
ground_truth.push_back(gt_pack_list[k].gt_values_);

Tools tools;
cout << "Accuracy - RMSE:" << endl << tools.CalculateRMSE(estimations, ground_truth) << endl;

But I got the following error, which I do not understand:

Undefined symbols for architecture x86_64:
"Tools::CalculateRMSE(std::__1::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>, std::__1::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > const&, std::__1::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>, std::__1::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > const&)", referenced from:
_main in main.cpp.o
"Tools::Tools()", referenced from:
_main in main.cpp.o
"Tools::~Tools()", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture x86_64

Could you hint me on what is wrong here?

I don't understand what would this be a duplicate.

Mornor
  • 3,471
  • 8
  • 31
  • 69

0 Answers0