By ComboZhc
on Thu, 01/31/2013 - 11:26
A stackoverflow reference asked by myself: http://stackoverflow.com/questions/14622533/how-to-import-c-header-file-in-iphone-ipad-project#comment20424090_14622533 First, I don't think it is an issue concerning any bugs of Vuforia. It is about how Vuforia organizes its namespace Here is the simple version of the problem: I have a huge project. Vuforia has ObjC++ headers, other libraries I use has ObjC headers and sources, my project codes also include ObjC headers and sources.When I tried to import Vuforia headers(e.g. #import <QCAR/QCAR.h>), Xcode prompts "no type named namespace". which means in an ObjC environment, it could not recognized C++ keyword namespace. I have tried:1. Modify the file type my project codes to `Obj C++ source`, which is equivalent to change from `.m` to `.mm`2. Modify my codes that they would strictly follow C++ standard(like assign a void* pointer to an int* pointer)Well, LLVM just raises me a link error,like "pinyinFirstLetter(unsigned short)", referenced from: -[NSString(LocaleHelper) stringForIndexTitle] in LocaleHelper.old: symbol(s) not found for architecture armv7 This function is in other libraries I used. So I guess I [b]HAVE TO [/b]modify other libraries to force them follow C++ standard, but that's [b]NOT[/b] what I want. I am using:
- Native SDK
- MacOS version number 10.8.2
- Xcode version number 4.5, Apple LLVM 4.1(GCC 4.2 would raise more awkward errors)
- iOS 6.0
How to #import QCAR C++ Header File in iPhone/iPad Project
Hi ComboZhc,
I have checked with the technicial gurus here to find the best way forward for you
Vuforia is a C++ API, so there is no way to call it from C or Objective C. Instead you need to use C++ or Objective C++.