I am currently learning C ++ and struggling with some kind of code:
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
Compiler Output:
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
I seriously do not understand.
source share