2016年4月15日 星期五

APPNAME was compiled with optimization - stepping may behave oddly; variables may not be available

Hope this article can help who meets same problem.


Description:

If you use third party static libraries, such as libav, ffmpeg in your app.
If you use cross compiler to build third party libraries.

In my environment, I have these third party library and use command line to build libav.a libwebrtc.a etc.. and put .a file into my xcode LIBRARY_LINK_PATH.

After I update my libraries to Xcode, I got runtime error :

"myapp was compiled with optimization - stepping may behave oddly; variables may not be available"


Solution:
When we use library in xcode, we have to update include files as well. In my case, I change some include file but forgot to update it to app project.

Even you use incorrect header file, xcode don't found it. So it can pass compile and crash until you access the new functions. Then, it shows error.

Please update .a and .h in the same time.


Yang