Mixing Objective-C and C++

后端 未结 5 1901
粉色の甜心
粉色の甜心 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:23

    Never mind, I feel stupid. All you have to do is rename AView.m to AView.mm so the compiler knows it's Objective-C++, and it compiles without a problem.

提交回复
热议问题