Xcode6 Beta + OF 0.8.1 for iOS 8.0


#1

Hi,

Just wanted to let you know that I installed the developer preview of Xcode 6 and am getting some linker errors with the iOS 8.0 SDK. I tried to build some examples and also the empty project, however I am getting the following errors:

ld: warning: ignoring file ../../../libs/FreeImage/lib/ios/freeimage.a, missing required architecture i386 in file ../../../libs/FreeImage/lib/ios/freeimage.a (2 slices) ld: warning: ignoring file ../../../libs/glu/lib/ios/glu-ios.a, missing required architecture i386 in file ../../../libs/glu/lib/ios/glu-ios.a (2 slices) Undefined symbols for architecture i386: "_fwrite$UNIX2003", referenced from: _WriteProc(void*, unsigned int, unsigned int, void*) in freeimage.a(FreeImageIO.o-i386) LibRaw::dcraw_thumb_writer(char const*) in freeimage.a(libraw_cxx.o-i386) _opj_image_create in freeimage.a(image.o-i386) _png_default_write_data in freeimage.a(pngwio.o-i386) LibRaw::ppm_thumb() in freeimage.a(dcraw_common.o-i386) LibRaw::jpeg_thumb_writer(__sFILE*, char*, int) in freeimage.a(dcraw_common.o-i386) LibRaw::write_ppm_tiff() in freeimage.a(dcraw_common.o-i386) ... "_mktime$UNIX2003", referenced from: LibRaw::get_timestamp(int) in freeimage.a(dcraw_common.o-i386) LibRaw::parse_rollei() in freeimage.a(dcraw_common.o-i386) LibRaw::parse_riff() in freeimage.a(dcraw_common.o-i386) "_strerror$UNIX2003", referenced from: Iex::throwErrnoExc(std::string const&, int) in freeimage.a(IexThrowErrnoExc.o-i386) "_strtod$UNIX2003", referenced from: _png_handle_sCAL in freeimage.a(pngrutil.o-i386)

Seems like some problems with freeimage libraries. I am running OSX 10.9. Also, the examples build successfully on Xcode 5.1.1 with the iOS 7.1 SDK.

Andrei


Issue Xcode6.1 iOS8.1
#2

@theo, I am also getting this error when I try to run the IOS_Testing using iOS Deployment Target as 6.0 (to avoid the tr1/memory problem). Any ideas?


#3

Hmm this looks like SDK related errors.
Is this just for the simulator or for building for device too?

We have seen this issue before with newer SDKs.

Maybe can you try setting the compiler for C/C++/Objective-C in the project settings to the same version that Xcode 5.1.1 uses?

Also maybe try setting the OS X Deployment Target variable to 10.7 or 10.6?


#4

I have similar issues with XCode6 Beta 3 (that contains swift) and oF 0.8.3 and current git master. openFrameworks libs builds fine with 10.10 SDKs, but all examples I have tried fail with

Undefined symbols for architecture i386:
  "_FT_Done_FreeType", referenced from:
      ofTrueTypeFont::finishLibraries() in openFrameworksDebug.a(ofTrueTypeFont.o)
  "_FreeImage_Initialise", referenced from:
      ofInitFreeImage(bool) in openFrameworksDebug.a(ofImage.o)
  "_FreeImage_DeInitialise", referenced from:
      ofInitFreeImage(bool) in openFrameworksDebug.a(ofImage.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@theo: Xcode 5.1.1 comes with LLVM 5.1, the new beta with LLVM 6.0 only. Deployment targets from 10.10 down to 10.7 did not make a difference.


#5

@theo: sorry for the late reply, these errors seem to appear only when building for the simulator, not when building for an actual device.
Running OF 0.8.1 + Xcode6 Beta 3 with the iOS 8.0 SDK.


#6

@cerkut your issue is a different one, actually, that affected OSX. The fix is now in the latest github master.

The problem was that freeimage wasn’t being linked via CoreOF.xcconfig. Related post.


XCode6 + iOS 8.1 + OF 0.8.4 + OSX 10.10 don't build
#7

Hey below is a dirty hack that I picked up from this website and that seems to fix @tazu’s linker issue :

Put this in main.cpp :

extern "C"{
    size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )
    {
        return fwrite(a, b, c, d);
    }
    char* strerror$UNIX2003( int errnum )
    {
        return strerror(errnum);
    }
    time_t mktime$UNIX2003(struct tm * a)
    {
        return mktime(a);
    }
    double strtod$UNIX2003(const char * a, char ** b) {
        return strtod(a, b);
    }
}

Issue Xcode6.1 iOS8.1
iOS8. The EmptyExample app does not work. "ld: symbol(s) not found for architecture i386"
iOS + Xcode 7 not working
Unable to compile 0.8.4 for iOS using Xcode 6.1.1, OS 10.10.2 on 64-bit iPad Air 1
#8

The errors @tazu is seeing are related to FreeLib, which needs to be recompiled for the correct architectures. There’s a group of people working on this. You can search the OF git for issues & PRs with the Apothecary tag.

I can confirm the code @kikko posted will get your simulator to run in Xcode 6, O.F. 8.1 & iOS 8 on the 6 and 6+

@kikko …That’s gross and amazing and you’ve saved me a bunch of time, wow.


#9

works perfectly, tnx