I get the "undefined reference to Mapmatcher::ransacMatches(cv::Mat, cv::Mat, Pose&)
" linking error in my project. I tried to create an MWE as shown below and believe the error will be clear from that. My guess was that I needed to put Mapmatcher::
in front of the function, but as I declared it in class Mapmatcher{}
it should not be necessary.
map_matcher_test_lib.h :
class Mapmatcher{
public:
Mapmatcher(void){};
void ransacMatches(cv::Mat matGlob, cv::Mat matLoc, Pose &pose);
};
map_matcher_test_lib.cpp :
#include "map_matcher_test/map_matcher_test_lib.h"
namespace map_matcher_test
{
//classes
class Mapmatcher{
void ransacMatches(cv::Mat matGlob, cv::Mat matLoc, Pose &pose)
{
// some code here...
}
};
}
map_matcher_test_node.cpp :
#include "map_matcher_test/map_matcher_test_lib.h"
Mapmatcher *mama = new Mapmatcher();
void mapMatcher()
{
// matGlob, matLoc, result known here
mama->ransacMatches(matGlob, matLoc, result);
}
int main (int argc, char** argv)
{
// some stuff...
mapMatcher();
}
Any help is appreciated.