Trying to use C ++ in an application for iPhone

I am trying to use C ++ in an iphone application. I added a line

#include <cstring>

in one of my files.

I get "error: cstring: no such file or directory". What do I need to do to make it work?

I understand that gcc is being called, but not g ++. How can I change this, or what flag can I add to force gcc to compile C ++?

+3
source share
2 answers

Objective-C ++ files must have the default .mm extension in the iPhone app ... otherwise this is probably a crazy way. Is there anything strange in the build settings?

+4
source

@robert, - .mm .cpp.

-x objective-c++
+3

Source: https://habr.com/ru/post/1732673/


All Articles