0

I got error for below code in Xcode 11.4

#include <stdlib.h>

Please see attach image enter image description here

I already copied c++ from Xcode 9.4 to Xcode 11.4 as described in below image

enter image description here

Still getting error. Please help me.

iPhoneProcessor
  • 4,980
  • 6
  • 27
  • 49
  • 1
    `I already copied c++ from Xcode 9.4 to Xcode 11.4` sounds like a mistake. You really should install in the proper manner instead of simply copying stuff around. – john Mar 28 '20 at 18:54
  • @john please tell me how to properly install c++ in Xcode 11.4 – iPhoneProcessor Mar 28 '20 at 18:57
  • Sorry I have no idea, but I do know that's what you should do. You also might need to undo any damage caused by copying stuff without properly installing. – john Mar 28 '20 at 18:59
  • Yeah wipe `/Applications/Xcode.app` and re-install. C++ is installed by default with Xcode. – trojanfoe Mar 28 '20 at 19:08
  • I just added `#include ` to a C++ project on Xcode 11.4 and it compiled OK. – trojanfoe Mar 28 '20 at 19:11
  • for me new cocos2dx compile but old cocos2dx project giving error..so someone suggested c++ fix https://forums.developer.apple.com/thread/106114 still its not working – iPhoneProcessor Mar 28 '20 at 19:17

1 Answers1

0

try using

#include <cstdlib>
#include <cmath>
Verain_the_great
  • 153
  • 1
  • 1
  • 6
  • 2
    It might help, but it's still perfectly legal to include in C++. – john Mar 28 '20 at 18:55
  • now its giving error for #include please tell me fix for this – iPhoneProcessor Mar 28 '20 at 19:01
  • 1
    Code only answers can almost always be improved by the addition of some explanation of how and why they work? – Suraj Kumar Mar 29 '20 at 04:26
  • While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply. [From Review](/review/low-quality-posts/25716210) – double-beep Mar 30 '20 at 07:06