old bird
old bird

Reputation: 77

c++ header file not found when compiling ios project in xcode

When I built an iOS project, I got an error "'tuple' file not found". Seems xcode is not trying to look for c++ header files.

The error message is: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/usr/include/simd/vector_make.h:5310:10: 'tuple' file not found

In vector_make.h, tuple is included:

#include <tuple>

This is originated from AVFoundation.h included by a c++ file "tdav_apple.mm":

#if TDAV_UNDER_APPLE
#if TDAV_UNDER_IPHONE || TDAV_UNDER_IPHONE_SIMULATOR
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>
#endif

How can I fix it? Thanks for your help!

Upvotes: 1

Views: 2852

Answers (1)

nmr
nmr

Reputation: 16849

I'd check and make sure your language version is at least C++11, since that's when tuple was introduced.

Snap of relevant build setting row

Failing that I'd verify the .mm file is properly tagged as C++ in the project file (select the file, then open the right hand side "File inspector" thing.)

Detail of file inspector

Upvotes: 2

Related Questions