I know this has been asked many times, but I can not understand this problem. This my header file:
#ifndef TASK_H
#define TASK_H
#include "storage_adaptors.hpp"
#include <boost/numeric/ublas/vector.hpp>
class Task {
private:
boost::numeric::ublas::vector<double> taskPosistionConstraint;
boost::numeric::ublas::vector<double> initialPosition;
boost::numeric::ublas::vector<double> finalPosition;
double pathLength;
int taskType;
public:
Task();
Task(double* _initialPoint, double* _finalPoint, int type);
double getLength();
int getTaskType();
~Task();
};
#endif /* TASK_H */
and this is the cpp file:
#include "Task.h"
const int TASK_SIZE = 3;
Task::Task() {
}
Task::~Task() {
}
Task::Task(double* _initialPoint, double* _finalPoint, int type) {
finalPosition = make_vector_from_pointer(TASK_SIZE,_finalPoint);
initialPosition = make_vector_from_pointer(TASK_SIZE, _initialPoint);
}
The error occurs at make_vector_from_pointer function that is defined in the storage_adaptors.hpp which is included in the Task.h which is a boost hpp file.
If the header is added to the class header file, why I’m having out of scope error:
Task.cpp:21: error: `make_vector_from_pointer’ was not declared in
this scope
If it’s a boost function, shouldn’t it be
boost::make_vector_from_pointer'? Or whatever namespace it’s in if not directly in the boost namespace.