Author Topic: __eprintf() and SDK 3.1.3  (Read 231 times)

LeoTh3o

  • Sr. Member
  • ****
  • Posts: 256
  • Reputation: 54
    • ET&C
  • Computers: MacBook Pro 15', half 2009, OS X 10.8.4
  • iDevices: iPad 2 WiFi iOS 5.1.1 jb
__eprintf() and SDK 3.1.3
« on: October 30, 2012, 02:00:07 pm »
// I'm not totally sure this is the right category, so move the post if needed

As I had to reset my iPad and start anew, I came across an issue about the SDK 3.1.3 (the default one installed):
Many programs call __eprintf from assert.h, which do not seem to be defined in the libgcc_s library. This is an obsolete function that is asked or provided by the source code using assert.h. Unfortunately, if assert.h grant the existence of the function, this is not re-defined by the package and this will lead to undefined symbol __eprintf...

After searching a bit, I found out its definition:

void __eprintf(const char* format, const char* assertion_expression, unsigned line, const char* file)
{
        fprintf(stderr, format, assertion_expression, line, file); 
        fflush(stderr);
}

In later SDKs (5.0>=) the definition is nested in #ifdef MACOSX_VERSION_MIN ...#endif

My solution is to update the header with one from SDK >= 5.0. This way the error won't show up.
« Last Edit: October 31, 2012, 02:20:50 pm by LeoTh3o »
0xEB        0xFE
jmp short -2