开发者

Xcode and Objective-C++ can't find <cstdio>

开发者 https://www.devze.com 2023-03-25 00:54 出处:网络
I\'m writing Cocoa code that uses some classes defined in a C++ library.I give the filename the extension .mm, and things are usually fine.

I'm writing Cocoa code that uses some classes defined in a C++ library. I give the filename the extension .mm, and things are usually fine.

But not always. Sometimes Xcode 4 disappoints me with: "Lexical or Preprocessor issue: 'cstdio' not found". I can't figure out how to make Xcode find it. Nor can I figure out why it works sometimes, but not others. What do you think?

开发者_运维技巧

Edit: Noise. My filename extension was not .mm, but rather .m. :( There is not, and there never was, a problem. See below.


It still should be able to find <stdio.h> just fine.

Edit: The .mm file should work fine all the time. Make sure in your build settings that Compile Source As is set to According to File Type

0

精彩评论

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