Rasmus
Rasmus

Reputation: 75

Access function from another project

I have this massive visual studio project with a lot of small projects in it. This header+source file is located in a project called Part and the Main file is in a project called Main. How can I access this function from another project?

//file.h
#include <otherfile.hxx>
#include <anotherfile.hxx>

namespace Part{
class MyClass{
.
.
void importStep(const char *FileName);
};
}

and my main file:

//Main.cpp
#include "file.h"

int main(){
    Part::importStep("file.stp");

return 0;
}

What it is complaining about is that the header files "otherfile.hxx" and "anotherfile.hxx" cannot be opened. They are located somewhere else but both projects are linking to that folder. But when I go to file.h, the other files can easily be accessed. Is there something else I can do to Access this function from another project? including file.h in the first place works. I cant include the other files because they will link to other files and that goes on for ever..

Upvotes: 0

Views: 2932

Answers (1)

oLen
oLen

Reputation: 5547

The problem is that the headers otherfile.hxx and anotherfile.hxx are not included in the project containing your Main.cpp. Go to the project properties and add the folder containing them in "Additional Include Directories"

Upvotes: 1

Related Questions