How to compile specific files in objective-c++ and the rest of the project in objective-c

前端 未结 3 625
醉酒成梦
醉酒成梦 2020-12-30 03:09

I\'m currently busy on a project where I need to use an external accessory to read Mifare 1k tags.

The accessory was provided with an SDK, written in (Objective ?)C+

相关标签:
3条回答
  • 2020-12-30 03:32

    I have resolved this problem:

    1. You should set "According to file type" to "Complile Sources As",
    2. Set "-ObjC++" to the "Other Linker Flags"
    3. The last,you should modify the files's suffix to .mm that reference the library method
    0 讨论(0)
  • 2020-12-30 03:39

    Select the file you want to compile as Objective C++ from the file navigator, and then select the File Type in the file inspector view. This is in Xcode 4, but there is a similar mechanism in Xcode 3.

    Selecting File Type from the file inspector

    0 讨论(0)
  • 2020-12-30 03:50

    Try renaming the files where you are including the library headers to myClass.h for interface and myClass.mm for implementation files. This forces the files to be compiled as objective-c++.

    0 讨论(0)
提交回复
热议问题