我开始尝试在iOS中启动开放框架项目。但是,我在启动示例项目时遇到了一些错误。我不知道该怎么做。任何帮助都将不胜感激。
我做了什么:
1下载用于iOS的开放框架
http://www.openframeworks.cc/versions/v0.8.4/of_v0.8.4_ios_release.zip
2将Deployment Target更改为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版。
发布于 2015-05-31 22:21:28
@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);
}https://stackoverflow.com/questions/30556201
复制相似问题