iOS8. The EmptyExample app does not work. "ld: symbol(s) not found for architecture i386"

I started to try to launch open Framework project in iOS. However, I got some errors during launch the example project.
I have no ideas how should I do. Any help will be appreciated.

What I did:

1 Download Open Framework for iOS

2 Change Deployment Target to 8.3. And then Launch Example project


3 I got some errors below.

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)

freeimage.a and glu-ios.a are seems to be existed in the folder.

My Xcode is Version 6.3.1.

checkt this post.

1 Like

@jeonghopark Thank you so much. It worked.

I put the code you told me in then build was OK. I can see the blank window on my iPhone simulator.

#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);
1 Like