Mixing Objective-C and C++

后端 未结 5 1903
粉色の甜心
粉色の甜心 2020-11-29 01:54

I\'m trying to mix Objective-C with C++. When I compile the code, I get several errors.

A.h

#import 
#include \"B.h\"

@interfac         


        
5条回答
  •  [愿得一人]
    2020-11-29 02:38

    In situations where you wish to introduce a simple C++ function like std::cout << then Hot Licks offers a good alternative.

    Change the "Identity and Type" From: Objective-C source To: Objective-C++ source

    The .mm extension simply identifies the file type; and then you are seeking a Objective-C++ not a Objective-C type.

提交回复
热议问题