I'm trying to use a C++ library (CLucene) from my Cocoa Touch iPhone application using Xcode 3.1.3. Everything works fine when I run in the iPhone simulator, but things get strange when I run on device. It seems like pointers aren't being passed correctly from the Objective-C++ code (my app) to the C++ library (CLucene).
While debugging the app on device, I can watch a const char* variable passed as a parameter to a C++ function change from 0x12546c0 in Objective-C++ to 0x4e in C++. Since 0x4e doesn't point to a valid const char*, the C++ code fails. This doesn't happen when debugging in the simulator.
I'm compiling the C++ library directly into the app, not linking to a static or dynamic lib.
Any help would be much appreciated.
Disabling "Compile for Thumb" in the project's build settings fixes the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With