Building with externals.

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Building with externals.

Post by Kaubs » Mon Nov 21, 2011 7:31 pm

So, I have closely followed this example with no results other than crashing and the inability to build properly.

http://www.runrev.com/developers/docum ... nals-sdk/

I can test on iOS 5 only nothing older than iOS 5 will test as it breaks with a memory leak error.

If I try and just build with livecode including the files I need I get the error attached in the screenshot.

I am 99% sure that the issue is not in my obj c code as all it does is return an int when called upon and my lc stack simply has a button to call the external.

Has anyone else had issues with this? Is there anything else I can include to help explain better?
Attachments
Screen Shot 2011-11-21 at 10.28.08 AM.png

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Building with externals.

Post by Kaubs » Tue Nov 22, 2011 12:57 am

Does anyone have a working NSString example?

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Building with externals.

Post by gpb01 » Tue Nov 22, 2011 11:46 am

Hi Kaubs,
which version of : Livecode, Livecode iOS SDK and XCode are you using ?

Let me know ...

Regards,

Guglielmo

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Building with externals.

Post by Kaubs » Tue Nov 22, 2011 6:11 pm

Xcode 4.2, iOS SDK r10, LiveCode 5.0.0

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Building with externals.

Post by gpb01 » Tue Nov 22, 2011 7:11 pm

Ok,
first iOS SDK R10 has a problem and you can test ONLY on the Simulator 5.0, any other version doesn't work (on R10 they use the library /usr/lib/libc++abi.dylib which is available only for Simulator iOS 5), so, to avoid problems simulate ONLY on Simulator iOS 5.

Next, about the architecture ...
... you have to build in a consistent manner the Livecode program and the external,

So ... in the "Standalone Application Settings" of Livecode, iOS panel, in Build Type select "Universal", next, on XCode 4.2, select the project, go to the Build Settings TAB and to the "Architectures" section, in Base SDK select "Latest iOS (iOS 5.0)", go down to the "Deployment" section and, in "iOS Deployment Target", select your iOS target (e.g. iOS 4.0).

Please get a look also to the "Build Options" section to make sure that "Compiler for C/C++/Objective-C" is set to "Default Compiler (Apple LLVM compiler 3.0)". Next, still for a better debug, from the top menu -> Product -> Edit Scheme, on the Info Panel, make sure that the "Debugger" is set to LLDB and not GDB !

Normally this works for me :)

Ah ... don't forget ... on the "binaries" folder you should have xxxxxxxx-5_0.dylib and xxxxxxxx.lcext for the Simulator, and ONLY xxxxxxxx.dylib and xxxxxxxx.lcext when you "Save as Standalone Application" on Livecode because, with the 5.0.0, Livecode will be confused by the presence of xxxxxxxx-5_0.dylib during the "Save as Standalone Application".

Hope this help ...

Guglielmo

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Building with externals.

Post by Kaubs » Tue Nov 22, 2011 7:41 pm

Thanks! It seems to point me in the right direction. I will see what I can do!

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Building with externals.

Post by Kaubs » Tue Nov 22, 2011 11:55 pm

Ok, so now that testing is working properly I am trying to figure out how to pass a nsstring to livecode. Is this a possibility? It looks like I'd use something like objc-string to make it happen but every time I write a function specifying objc-string in the lcidl file it breaks. Has anyone done this?

Thanks a ton!

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Building with externals.

Post by gpb01 » Wed Nov 23, 2011 5:10 am

Kaubs wrote:Ok, so now that testing is working properly I am trying to figure out how to pass a nsstring to livecode. Is this a possibility? It looks like I'd use something like objc-string to make it happen but every time I write a function specifying objc-string in the lcidl file it breaks. Has anyone done this?

Thanks a ton!
Hi Kaubs,
if you get a look to the "rresocket" sample of "Livecode iOS SDK", maybe you can find the answer :)

As described in "iOS Externals SDK" web page (Home -> Developers -> Documentation -> iOS Externals), they use "objc-string - converted to/from a native NSString * object." ...
... looking into rresocket.lcdil / rresocket.mm file you have some 'command' using it (e.g. rreSocketOpen, rreSocketRead, rreSocketWrite, ...).

Work fine for me ...

Guglielmo

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Building with externals.

Post by Kaubs » Wed Nov 23, 2011 6:20 pm

Nice, I see that in their code. There is however an issue, when I try to launch the project in the simulator (5.0) it just hangs with "attaching to test" in Xcode. Are you using the latest version of xcode, livecode sdk and livecode?

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Building with externals.

Post by gpb01 » Wed Nov 23, 2011 7:24 pm

Kaubs wrote:Nice, I see that in their code. There is however an issue, when I try to launch the project in the simulator (5.0) it just hangs with "attaching to test" in Xcode. Are you using the latest version of xcode, livecode sdk and livecode?
Hi Kaubs,
Livecode 5.0.1 (rc1), XCode 4.2 build 4C199 (I'm on SnowLeopard), iOS Simulator 5.0 (272), Livecode iOS SDK R10 ... and all run fine :)

Sure you have selected "test > iPhone 5.0 Simulator" on the top-left of XCode (near the Run and Stop buttons) ?

Guglielmo

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Building with externals.

Post by Kaubs » Wed Nov 23, 2011 7:48 pm

Yessir, It's quite strange. I've tried both the r8 and r10. I was able however to get a dumbed down version of an NSString function to work so thank a ton! I think I will be able to finish my project now.

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm
Location: Switzerland

Re: Building with externals.

Post by gpb01 » Wed Nov 23, 2011 8:09 pm

Happy to have been helpful :)

Guglielmo

Kaubs
Posts: 124
Joined: Wed Jun 29, 2011 3:55 am

Re: Building with externals.

Post by Kaubs » Wed Nov 23, 2011 8:29 pm

Yep! Everything worked and is built. Thanks again! I couldn't have done it without you!

RajaRamesh
Posts: 23
Joined: Fri Jan 31, 2014 12:09 pm

Re: Building with externals.

Post by RajaRamesh » Sat Jul 26, 2014 6:46 am

Dear Kaubs,
iam facing 3 errors while iam building rremicrophone, rrehardcopy on xcode5.1.1 for ios7.1, for LC6.5.2 stable versions.

these are errors:-
Users/ensis/Library/Application Support/RunRev/Components/LiveCodeSDK/tools/lclink.sh: line 34: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++: No such file or directory
error: linking step of external dylib build failed, probably due to missing framework or library references - check the contents of the rremicrophone.ios file
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure


could you please guide me how to resolve this, or could u please build and give those(rremicrophone, rrehardcopy) lcext files for ios7.1.
please help me Kaubs, iam struggling alot with this.
Thanks

Post Reply

Return to “iOS Deployment”