I am wondering how would I reference a file from another project in C++.
For example, I have moved avocado.h
from my Vegetable project to Fruit project. In fruit.cpp, I am trying to include avocado.h
, but the compiler cannot find avocado.h
.
Original recipie.cpp:
#include "avocado.h" //error c1083: Cannot open included file: 'avocado.h':No such file or directory
My existing solution is to use namespaces, but I am wondering if it will be much more efficient for me to somehow tell #include
exactly where to look?
Current recipie.cpp:
namespace fruit {
class avocado;
}
EDIT - Sorry, I should mention that I am working in a Solution (or library) where both Fruit and Vegetable projects are under the same solution.