I’m having an issue with 007, both the official bundle and the most recent GitHub, where the assimpExample in iPhoneAddonsExamples works in the simulator, but on the iPhone 4 and iPad (OS 4.3.5) I get a EXC_BAD_ACCESS:
aiVector3D.h on line 63 aiVector3D () : x(0.0f), y(0.0f), z(0.0f) {}
Is anyone able to run the example on a device? Any known fixes?
I’ve found a solution for to compile the assimp library examples on iPhone / iPad devices:
Set the compiler to GCC 4.2 by default in the newer versions of xCode, it’s LLVM GCC 4.2, which fail on the device at the aiVector3D() line above.
The downside is Apple is no longer supporting the GCC compiler, and is moving to LLVM. I tried re-compiling the assimp libraries from source without luck on the newer compiler. If there are any more future-proof solutions, let me know… in the meantime, it’s working!
I can’t run the assimp loader on an iOS5 device if I’m using the latest Xcode 4.2. Xcode 4.2 doesn’t have the GCC 4.2 compiler and neither LLVM GCC 4.2 or LLVM 3.0 work.
My running code gets the same error as Stephen - EXC_BAD_ACCESS in aiVector3D
So I think you’d need to mess with a bit to get it compiled, but the iOS OF devs of the world would gift you 1000 internets if you get the library properly compiled with LLVM. I’m on old XCode until a project ends, so if it’s still not sorted by then I can do it, but it’ll be a few weeks.
So if I can compile a static library for assimp using LLVM and then replace assimp.a I should be on the right track?
of_preRelease_v007_iphone/addons/ofxAssimpModelLoader/libs/assimp/lib/osx/assimp.a & iPhone/assimp.a
I’ve been working with the assimp trunk, but is the OF source available that was used to build the OF version of the assimp library. I can’t find it on Github.
Would I have better luck working with the latest Github source?
If you figure this out let me know… I’ve got an install of Xcode 4.1 just for a project using ASSIMP, but it worries me as newer versions of Xcode no longer support the GCC compiler.
I wasn’t able to compile ASSIMP for LLVM (Josh’s note above), and set it aside as I found a workaround with 4.1. I’d be happy to dive back in again if needed.
I haven’t figured it out yet to work with OF, but a developer on the assimp team has updated the SVN to include a cmake script in port/iOS to build a LLVM GCC 4.2 version of the library.
When I bring the library into the OF assimp example I still get an EXC_BAD_ACCESS though. Maybe you can get farther than me, but I’m not even able to debug it in this state.
So if I can compile a static library for assimp using LLVM and then replace assimp.a I should be on the right track?
of_preRelease_v007_iphone/addons/ofxAssimpModelLoader/libs/assimp/lib/osx/assimp.a & iPhone/assimp.a
I think so, yes.
I’ve been working with the assimp trunk, but is the OF source available that was used to build the OF version of the assimp library. I can’t find it on Github.
The version of Assimp was *probably* the latest release or maybe one back. I can’t imagine that it would be a big difference though, the main problem is getting is cross-compiled for ARM.
Would I have better luck working with the latest Github source?
Of OF? It shouldn’t matter too much for this, though there have been some iOS fixes I don’t think any of them are related to Assimp.
"To build for iOS simply execute “./build_ios.sh” from this folder. Currently this script requires the latest SDK (5.0) from Apple in order to build properly. In the future I will add support for specifying the SDK version on the command line. "
The library is easy to build and compiles just fine. When I bring it back into OF I don’t have any luck getting past the EXC_BAD_ACCESS error in aiVector.
I can also report that I can’t get this to work. I’ve recompiled assimp.a from their SVN and copied it across. I’ve recompiled the project with LLVM GCC 4.2, but I still get the crash on a class constructor:
#0 0x001974ac in aiVector3D::aiVector3D() () #1 0x0000fcec in ofxAssimpModelLoader::ofxAssimpModelLoader() at /Users/ajs/dev/of_preRelease_v007_iphone/addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp:128 #2 0x00003c64 in testApp::testApp() () #3 0x000024a8 in main at /Users/ajs/dev/of_preRelease_v007_iphone/apps/iPhoneAddonsExamples/assimpExampleTest/src/main.mm:14
This is related to the default construction of variables:
aiVector3D scene_min, scene_max, scene_center
in ofxAssimpModelLoader.h but it you just cut those out and workaround for testing, you hit other strange errors to do with static initialisation of strings inside assimp.
Also reference is made to running on iOS5 devices. I can’t run it on my iphone with 4.3.2 either.
ok, this was a bug with an older version of cmake that i had installed.
upgrading the the latest (2.8.7) had fixed this error.
bring on the next hurdle!
ive done a little digging around the internets and it can potentially be a LLVM bug.
found a few bug reports that describe similar behaviour.
i also got the latest trunk of Assimp compiling with GCC 4.2 - LLVM 3.0 but that didn’t resolve the issue.
in either case, until Assimp or LLVM resolve this issue ive downgraded to XCode 4.1 using GCC 4.2
everything works and i can run the example on my iOS5 device.
ive recently upgraded to Lion and running the latest Xcode 4.3.1
using the Apple LLVM compiler 3.1 this is no longer an issue.
it must have been an issue with the LLVM 3.0 compiler all along…
not sure what can be done for the people still using this compiler.
probably the only thing to do is to downgrade to XCode 4.1 and use the GCC 4.2 compiler or upgrade to latest Xcode 4.3.1 on Lion and use LLVM 3.1 compiler.