Open Framework:EmptyExample应用程序在iOS8中不起作用。 “ld:找不到架构i386的符号”

时间:2015-05-31 10:09:05

标签: ios openframeworks

我开始尝试在iOS中启动开放框架项目。但是,在启动示例项目期间,我遇到了一些错误。 我不知道该怎么办。任何帮助将不胜感激。

我做了什么:

1下载适用于iOS的Open Framework

http://www.openframeworks.cc/versions/v0.8.4/of_v0.8.4_ios_release.zip

2将部署目标更改为8.3。然后启动示例项目

/Users/Zono/Downloads/of_v0.8.4_ios_release/apps/myApps/emptyExample/emptyExample.xcodeproj

3我在下面遇到了一些错误。

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)
opjimage_create in freeimage.a(image.o-i386)
pngdefault_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(dcrawcommon.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:
pnghandle_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)

freeimage.a和glu-ios.a似乎存在于文件夹中。

我的Xcode是版本6.3.1。

1 个答案:

答案 0 :(得分:0)

@jeonghopark在openFrameworks的论坛中告诉我答案。它运作正常。

我把这个代码放在@jeonghopark下面告诉我。

#include "ofMain.h"
#include "ofApp.h"

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);
    }
}

int main(){

    ofSetupOpenGL(1024,768, OF_FULLSCREEN);         // <-------- setup the GL context

    ofRunApp(new ofApp);
}