‘cstdlib’ file not found – how to fix/solve
I’m back after almost a year of silence to share a quick tip with anone out there who might run into this issue trying to call C++ through C or Objective-C and runs into this error message:
“‘cstdlib’ file not found”
All you need to do is make sure all files calling C++ methods are treated as C++ files by the compiler – in other words change the extension from .m to .mm (for objective-c++).
I ran into this issue trying to create an iPhone app that integrates closely with openFrameworks, using ofxiOS rather than ofxiPhone. The way my files were including each other caused LLVM to get baffled when C++ calls were made from C files and it gave me this rather obscure error message. Hopefully you will find this post before you pull too many hair out.