ofxAssimpModelLoader not compiling in iOS with OF0.10.1

I’m trying to utilize ofxAssimpModelLoader but it does not compile on iOS (Xcode 10.1).

I found an old issue on GitHub that points to the same error I have:

Undefined symbols for architecture arm64:

“irr::io::createIrrXMLReader(irr::io::IFileReadCallBack*)”, referenced from:

Assimp::IRRImporter::InternReadFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, aiScene*, Assimp::IOSystem*) in assimp.a(IRRLoader.cpp.o)

Assimp::XGLImporter::InternReadFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, aiScene*, Assimp::IOSystem*) in assimp.a(XGLLoader.cpp.o)

Assimp::D3MFImporter::InternReadFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, aiScene*, Assimp::IOSystem*) in assimp.a(D3MFImporter.cpp.o)

Assimp::IRRMeshImporter::InternReadFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, aiScene*, Assimp::IOSystem*) in assimp.a(IRRMeshLoader.cpp.o)

Assimp::AMFImporter::ParseFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Assimp::IOSystem*) in assimp.a(AMFImporter.cpp.o)

Assimp::Ogre::OgreImporter::InternReadFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, aiScene*, Assimp::IOSystem*) in assimp.a(OgreImporter.cpp.o)

Assimp::ColladaParser::ColladaParser(Assimp::IOSystem*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in assimp.a(ColladaParser.cpp.o)

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ideas on how to solve this?

My solution is to build the assimp libraries from the source code. ( I don’t know whether it is a good solution or not. :slight_smile: )

  1. Donwload the source code from https://github.com/assimp/assimp
  2. Build the library. https://github.com/assimp/assimp/tree/master/port/iOS
  3. Copy the “libassimp.a”, “libIrrXML.a”, “libzlibstatic.a” and the “include” folder to ofAssimpModelloader (“include” folder and “ios/lib” folder)

It works at oF 0.10.1 (git master version), iOS 12.1, Xcode 10.1.

1 Like

Thank you @jeonghopark!

I managed to run the examples but I needed one additional step.

I needed to add manually the files xcode, and I needed to rename 3 files to:
lassimp.a
lIrrXML.a
lzlibstatic.a

or you can use the projector generator. :wink:

1 Like

Hello! I tried your solution, but my problem is that assimp compiled me libassimp.a, libassimp-fat.a, and from the assimp source code i also got the libzlibstatic.a in the assimp-master/contrib/zlib folder. My problem now is where to get the libIrrXML.a. I tried to copy it from the osx version of ofxAssimpModelLoader addon and put it on the ios folder, but Xcode says it can’t be linked because is a version for osx, not ios. How did you compile all those files? Not only the libassimp.a, which was the file I got following the instructions you gave in the link. I would love some help on this topic, i am trying to do some aumented reality with 3d shapes on my iphone 6, and using 3d objects has been hell on ios.