开发者

C++ Xcode assert evaluated in release

开发者 https://www.devze.com 2022-12-15 19:13 出处:网络
I\'m quite new to Xcode (and Mac in general). I started a little iPhone project - coding in C++ whatever possib开发者_StackOverflowle - and just noted that my assert(); commands are executed also in r

I'm quite new to Xcode (and Mac in general). I started a little iPhone project - coding in C++ whatever possib开发者_StackOverflowle - and just noted that my assert(); commands are executed also in release mode.

Is this a known problem and how do I solve it properly?

thanks!


Xcode does not add -DNDEBUG for release mode automatically.

To add it, go to Project | Edit Project Settings. You need to be on the Build tab and choose Configuration Release. Add a new Preprocessing Macro of NDEBUG.

0

精彩评论

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

关注公众号