I am creating an iphone test using c++,and I want to use nslog( the only way to show debug information?) whenever I want to include nslog function my cpp has to change to mm right? is it the only way to do it? because I don't want to change back to cpp when I move to other platform.
thanks for help
Since NSLog only exists on Objective-C platforms, why not create your own LogMessage()
method taking standard C++ arguments in a single .mm file that calls NSLog and call that from C++ files named as usual. That way you'll not need to rename every single file that needs to log to .mm
On other platforms, just include another implementation of LogMessage()
since there's no NSLog to call there anyway.