开发者

Compile cxx files in xcode

开发者 https://www.devze.com 2023-04-04 07:43 出处:网络
I am new a开发者_高级运维t IPHone development , I included a library with .cxx as implementation class and a .h header but still i get error at compiling , Please any help?

I am new a开发者_高级运维t IPHone development , I included a library with .cxx as implementation class and a .h header but still i get error at compiling , Please any help? I get errors at lines like below

class StackEvent;


The Objective-C class that is including any C or C++ code must be renamed with a ".mm" suffix rather than ".m" in the implementation class.


Any Objective-C file (.m) that includes any header containing C++ code, either directly or by chained #includes, will likely fail with compile errors.

You need to rename all your .m files to .mm if they can "see" your C++ header.

If that causes too much renaming, then you'll have to limit your #includes, for example by take the C++ #include out of your header file and putting it only in the .mm files that need it.

0

精彩评论

暂无评论...
验证码 换一张
取 消