Why am I getting this clang: _fwrite $ UNIX2003 error on a simulator with iOS 8

I downloaded the new iOS 8 to both phones and the latest Xcode on my Mac. Everything works fine, but after downloading and testing the new iPhone 6 plus simulator, when I try to use iPhone 4 or 5 simulators (it works with 5s), I get the following error:

Undefined symbols for architecture i386: "_fwrite$UNIX2003", referenced from: leveldb::(anonymous namespace)::PosixEnv::~PosixEnv() in Firebase(env_posix.o) leveldb::(anonymous namespace)::PosixEnv::~PosixEnv() in Firebase(env_posix.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

It seems strange to me that I use the iPhone 4 simulator all morning, but only after I try the iPhone 6 plus the simulator that it breaks, and I can not get it back

+7
ios xcode ios8 ios-simulator
source share
2 answers

The answer provided in this link is great for me.

According to the link above, To remove all these errors, you need to create a * .c file (no specific name is needed) and copy paste the following code:

 #include <stdio.h> #include <unistd.h> #include <string.h> #include <stdlib.h> FILE *fopen$UNIX2003( const char *filename, const char *mode ) { return fopen(filename, mode); } int fputs$UNIX2003(const char *res1, FILE *res2){ return fputs(res1,res2); } int nanosleep$UNIX2003(int val){ return usleep(val); } char* strerror$UNIX2003(int errornum){ return strerror(errornum); } double strtod$UNIX2003(const char *nptr, char **endptr){ return strtod(nptr, endptr); } size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d ) { return fwrite(a, b, c, d); } 

usually everything should be fine.

+12
source share

fwrite $ UNIX2003 is a character provided by OS X and is not part of the iOS Simulator runtime. iOS is always compatible and therefore does not have an obsolete (not $ UNIX2003) version of the features (which are provided for binary compatibility with code created for older versions of the OS X SDK).

The common cause of the problem you see is that you have an object file or archive (env_posix.o or libsomething.a that contains env_posix.o) that was created against the OS X SDK and is trying to link it into your executable iOS Simulator This is not supported because the two platforms are not compatible with binary data at this level.

You need to rebuild env_posix.o against the iOS Simulator SDK.

+5
source share

All Articles