4

I am working with Wikitude SDK and while adding some file supported in Wikitude example folder its showing me Foundation file error like below.

In file included from /Volumes/DATA/Dhanesh/Projects/experiments/AR/ARWikiDemo/ARWikiDemo/WikiSDK/Controller/Examples/Categories/PluginsAPI/CustomCamera/YUVFrameInputPlugin.cpp:11: In file included from /Volumes/DATA/Dhanesh/Projects/experiments/AR/ARWikiDemo/ARWikiDemo/WikiSDK/Controller/Examples/Categories/PluginsAPI/CustomCamera/WTDeviceCamera.h:9: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:492:1: error: expected unqualified-id @class NSString, Protocol;

Not getting whats wrong here but it says that

All NSString, NSObject, NSLog are unqualified-id @class

I have set all related Linker flag and Header & Library search paths for that but still getting the above error.

Can anyone guide me on this whats going wrong here?

Error Screenshot for reference:

enter image description here

Thanks in Advance!

2
  • 1
    Do you want to use Obj-C classes in the file? If so, change the file ending to .mm to use the Obj-C++ compiler. Commented Sep 1, 2017 at 15:14
  • Yes I have some classes with.cpp ext but strange thing is that the same .cpp ext working in Wikitude demo but while I want to create new demo its throwing above error. Commented Sep 4, 2017 at 5:36

1 Answer 1

7

For the Above issue, I struggle a lot, and finally, I am concluding this with the below solution.

  • To use .cpp file in ObjC we required to convert that .cpp extension to .mm for ObjC++ compiler only. (thanks Mats for your comment it's helped me a lot.)
  • Compile the source as ObjectiveC++ in the Build setting.

Ref Link 1: Objective-C++ and .cpp files in Xcode

Ref Link 2: Adding C++ code to an iOS project

Hope this will help others who are facing the same issue related to it.CPP ext.

Thanks.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.