Mohanad Kaleia
Mohanad Kaleia

Reputation: 791

How to work around header not found in xcode

#include "missing.h"

I have a library that have missing.h header file which in Full version of the framework I include that library but in lite version I don't want to link that library..

But in objective c when you include missing file it will not continue building it will show an errors that the header "missing.h" is not found.

How can I work around this problem? like to say if the header not found don't include it at all

Upvotes: 0

Views: 99

Answers (2)

Duncan C
Duncan C

Reputation: 131418

Ian's answer is good if you really need to not include the header.

Note that #importing the header does not mean that the binary for the library is included in your project, and conversely, not importing the header does not prevent the library's binary from being linked into your project.

The more important thing is changing the build phases step of your "lite" target so it doesn't copy the library into your "lite" application.

Upvotes: 0

Ian MacDonald
Ian MacDonald

Reputation: 14020

You could use preprocessor directives.

#if FULL_VERSION
#include "missing.h"
#endif

Upvotes: 1

Related Questions