开发者

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

开发者 https://www.devze.com 2023-03-30 08:03 出处:网络
I have a header name \"Header.h\" in project A and i try to import it in sub-project B by using the standard

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 ?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号