This is my error when trying to compile:
Undefined symbols for architecture x86_64:
"Model::Model(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::vector<int, std::__1::allocator<int> >)", referenced from: ____C_A_T_C_H____T_E_S_T____4() in tests.cpp.o
I have read that std::string is a typedef of std::basic_string and I'm guess that std::vector is a typedef of... std::vector and std::allocator? or something...
Anyway. I have a Settings class that holds my settings and a Model class that contains my model. The code I am attempting to run is as below, and I am unable to compile it. the issue is with it not recognising my model constructor.
Settings s = Settings("../config/settings.json");
std::string mf = s.get_model_file();
std::vector<int> vec = s.get_input_shape();
Model m = Model(mf, vec);
For reference here is my Model class header:
class Model {
public:
Model(std::string model_file, std::vector<int> input_shape);
~Model();
double* get_ref_to_input_buffer();
std::string predict();
private:
std::string _model_file;
fdeep::model _model;
fdeep::shape3 _input_shape;
int _input_size;
double* _input_buffer;
fdeep::tensor3s _result;
void _load_model();
void _set_input_size(std::vector<int> input_shape);
void _set_input_shape(std::vector<int> input_shape);
void _create_input_buffer();
std::string _result_to_string();
};
and my Model class constructor:
Model::Model(std::string model_file, std::vector<int> input_shape) {
_model_file = model_file;
_load_model();
_set_input_size(input_shape);
_set_input_shape(input_shape);
}
These are the function being called in the constructor:
void Model::_load_model() { _model = fdeep::load_model(_model_file); }
void Model::_set_input_size(std::vector<int> input_shape) {
int total = 1;
for (std::vector<int>::iterator it = input_shape.begin();
it != input_shape.end(); ++it) {
total *= *it;
}
_input_size = total;
}
void Model::_set_input_shape(std::vector<int> input_shape) {
_input_shape = fdeep::shape3(input_shape[0], input_shape[1], input_shape[2]);
}
If anyone could point out where I'm going wrong or send me in the direction of what I need to read / learn that would be great. Thank you!