Alex
Alex

Reputation: 11137

How can i use the headers in the main project in a subproject?

I have a header name "Header.h" in project A and i try to import it in sub-project B by using the standard

#import "Header.h"

The thing is that although auto-complete finds my header and though my header is used in other places with success, i get an error telling me that the header couldn't be found.

How can i include in a subproject the headers from the main project without having to copy all the headers ?

Upvotes: 1

Views: 603

Answers (2)

xuzhe
xuzhe

Reputation: 5120

That's a little bit weird to use main project's .h file in a sub-project. It will cause the two projects can NOT be separated any more. That's not the project / sub-project struct designed for.

So, why don't you just move all of those classes from your main project into your sub-project if so you can still use them from your main project?

Anyway, if you insist on keeping those classes in your main project, have you tried to add those .h files into your sub-project? You do NOT need to copy them into your sub-project, just add them as references should be OK.

Upvotes: 4

cutsoy
cutsoy

Reputation: 10251

Are you sure it's in your app's folder? If not, you have to add it's parent-directory to the Header Search Paths-variable in your Target Settings.

Upvotes: 0

Related Questions