Thank you for visiting the BlackBerry Support Community Forums.
- Kevin Michaluk, Founder, CrackBerry.com
10-15-2013 06:40 AM
I am trying to do something fairly simple, build a standard C++ library in Xcode and add this library to my BlackBerry application as a 3rd party library.
I have seem to generate ".a" and ".so" files but linking in Momentics doesn't give much more than the following:
Any advice would be greatly appreciated. Is this even possible, anything should be?
10-15-2013 07:22 AM - edited 10-15-2013 07:26 AM
Just one question, if this is standard C++ library, why you want to build it in xcode, why not in Momentics ide?
If this library is in objective C, read this: https://developer.blackberry.com/native/documentat
10-15-2013 07:49 AM
10-16-2013 09:50 AM
So I have managed to compile with Xcode.
I then use libtool to extract my .so files for 2 valid architectures: armv7 and armv7s.
On importing these to Momentics, I see...
Library is not compiled for the correct architecture: *path to my file*
If anyone has guidance on why these are not correct, it would be much appreciated.
I'm assuming others have compiled with Xcode and imported their libraries to Momentics BlackBerry projects.
10-22-2013 04:19 AM
The linking / building process is not explained in this documentation: http://developer.blackberry.com/native/documentati
I have left a comment on this in hopes of a BlackBerry developer that has an example or answer to this would clarify their documentation.
I have opened another thread to further explain my issue: http://stackoverflow.com/questions/19406949/can-i-
10-22-2013 11:11 AM
10-23-2013 03:37 AM
I have compiled 2 tests outside of Xcode with GCC and QCC.
The files from GCC compiler (armv7 as an ".so" lib) still produce "incorrect architecture" in Momentics...
After that, I tried extracting and repackaging the ".o" object files with QCC:
daxfrost$ qcc -Vgcc_ntoarmv7le -shared -o libQCCShared_armv7.so ./obj/*.o
./obj/Test.o: file not recognized: File format not recognized
Looking at the format of the GCC produced .so library and one of its .o object file:
daxfrost$ file libShared_armv7.so
libShared_armv7.so: current ar archive random library
daxfrost$ file Test.o
Test.o: Mach-O object arm
Whereas the object files from the compatible library built with the QCC compiler are in ELF format.
daxfrost$ file libShared.so
libShared.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped
daxfrost$ file Test.o
Test.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
I am able to link this fine in Momentics, which leads me to believe that the "invalid architecture" refers to this difference in format? ...And the reason I am looking for an example or more info in the documentation.
Thank you for your assitance.
10-23-2013 12:16 PM
Thanks for sharing what you found. It makes sense that you got the error message about the different architeture since Mach-O is not supported on Momentics/BB platform.
It should definitetly documented that the defferences and issues during the compile and build process. I'll get in touch with the BlacBerry doc team to address the possible issues like you are going through.
10-24-2013 04:06 AM
Could you please let me know what the outcome is, as the documentation lead me to believe one can wrap Objective C code and use it on the BlackBerry platform.
I'd just like to know if this is not true.