Question

When I create an iOS project,and "Build Phases -> Link binary with Libraries", I add the AVFoundation.framework lib and use #import "<AVFoundation/AVFoundation.h>". I get a compilation error:

"AVFoundation/AVFoundation.h file not found".

Here's my code:

#import <UIKit/UIKit.h>
#import "<AVFoundation/AVFoundation.h>"  

How can I resolve this?

Was it helpful?

Solution

Use

#import <AVFoundation/AVFoundation.h>

There is only two types of #import statements:

#import <file.h>

and

#import "file.h"

There is no type like : #import "<file.h>" you are making mistake here: #import "<AVFoundation/AVFoundation.h>"

In general the #import "QuartzCore/QuartzCore.h" form is "find my very own header, if you can't find it look for a system header", and the form is "find a system header". In theory the locations are compiler defined and they could be implemented differently on a given platform, but I haven't run into a C compiler that does anything different.

Reference: SO

OTHER TIPS

You have extra quotes.

Use

#import <AVFoundation/AVFoundation.h>

not

#import "<AVFoundation/AVFoundation.h>" 

please do not use

#import "<AVFoundation/AVFoundation.h>"  

use this

#import <AVFoundation/AVFoundation.h>

we can import two type of library

first one is System Library which are developed by Apple developer

are imported as

 #import <Library.h>

Second one is Classes implemented by Application developer

like as

#import "Library.h"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top