Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Xcode assert evaluated in release

I'm quite new to Xcode (and Mac in general). I started a little iPhone project - coding in C++ whatever possible - 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!

like image 219
genesys Avatar asked Jan 10 '10 00:01

genesys


1 Answers

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.

like image 100
R Samuel Klatchko Avatar answered Sep 27 '22 20:09

R Samuel Klatchko