В настоящее время я изучаю c ++ и борюсь с кодом:
Garden.h:
#ifndef GARDEN_H_
#define GARDEN_H_
#include <vector>
#include <boost/tr1/memory.hpp>
#include "Shape.h"
#include "Utils.h"
namespace cma {
typedef boost::shared_ptr<cma::Shape> ShapePtr;
typedef std::vector<cma::ShapePtr> GardenPlan;
}
#endif /* GARDEN_H_ */
Utils.h:
#ifndef UTILS_H_
#define UTILS_H_
#include "Garden.h"
namespace cma {
void printList(GardenPlan const & p, std::ostream & o);
}
#endif /* UTILS_H_ */
Вывод компилятора:
In file included from ../src/Garden.h,
from ../src/Utils.cpp:
../src/Utils.h: error: variable or field 'printList' declared void
../src/Utils.h: error: 'GardenPlan' was not declared in this scope
../src/Utils.h: error: expected primary-expression before '&' token
../src/Utils.h: error: 'o' was not declared in this scope
Я серьезно просто не понимаю.