I have a class Settings declared like this (in Settings.h file) - just part of it:
class Settings {
public:
Settings(const edm::ParameterSet& iConfig);
~Settings(){}
}
Then I want to use it in another class called TMTrackAnalyzer. In TMTrackAnalyzer.h I have this:
#include Settings.h
class TMTrackAnalyzer : public edm::EDProducer {
public:
explicit TMTrackAnalyzer(const edm::ParameterSet&);
~TMTrackAnalyzer(){}
private:
Settings *settings_;
}
and in TMTrackAnalyzer I have this:
TMTrackAnalyzer::TMTrackAnalyzer(const edm::ParameterSet& iConfig)
{
settings_ = new Settings(iConfig);
}
When I run the code I get this error:
undefined reference to `Settings::Settings(edm::ParameterSet const&)'
collect2: error: ld returned 1 exit status
As far as I understand this error appears mainly when you don't call the function properly (with the same parameters that you define it with), but I can't find the reason why I get this error. Can someone help me? Thank you!