openFrameworks for iOS가 Xcode6에서 빌드 할 수없는 문제 수정

4895 단어 C++iOSopenFrameworks
ofruby를 Xcode6에서 빌드하려고하면 이상한 링크 오류가 발생했습니다.
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)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

_fwrite$UNIX2003 라고 뭐야・・・ 검색해 보았다.

FreeImage has undefined symbols for i386 for Xcode 6 beta 6 + iOS Simulator · Issue #3178
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);
    }
}

위와 같이 더미의 함수 정의를 추가하면 좋다. ofruby의 main.mm에 함수를 추가하면 움직이게 되었다.

8 예 9073 · 온가에시

이제 iOS8에서도 ofruby가 움직일 것 같다.

좋은 웹페이지 즐겨찾기