rnaHello tutorial - Mac Xcode Arggggggg!!!!

Are you developing an External using the LiveCode Externals SDK?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Simon Knight
Posts: 339
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

rnaHello tutorial - Mac Xcode Arggggggg!!!!

Post by Simon Knight » Tue Mar 20, 2012 12:42 pm

I think that my comments are aimed towards Edinburgh.

I started my journey into the darkness that is "externals" with a naive question about using commands contained in a .dylib file (perhaps the mac .dll file) see http://forums.runrev.com/viewtopic.php?f=7&t=11419, I had hoped that it would be simple to use the routines contained inside the file. However, it is not.

It seems that I need to create a Livecode External file that acts as a wrapper for the commands that I wish to use. So I need to learn how to do this. First I watched some video recorded at RunRev09 where the speaker explains how the "new" externals API works and is so much simpler than the old externals API. This new API will be released at the "end of the month - 2009). Unfortunately this new API has not been released, but hey ho these things happen.

Next I turned to the tutorial "Externals 1". This tutorial is written against RunRev 2.6 (thats not a misprint v2.6) and while it does a good job of hand holding the new user of Xcode (me) it seems doomed to failure: As Elizabeth points out in her post along the same lines as this one (http://forums.runrev.com/viewtopic.php?f=17&t=11223) The #includes are blank when I think they should read

Code: Select all

#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <revolution/external.h>
Elizabeth also reports problems with the line

Code: Select all

#include <revolution/external.h>
with external.h not being found. Mwieder suggests that she add the path to her project - I tried but seem to have managed to add the file (external.h) to my xcode project and yes I don't really have a clue what I am doing.

When I select build the following error is posted : "error: There is no SDK with the name or path 'Developer/SDKs/MacOSX10.4u.sdk" which I think is part of libexternal, and I have to agree with xcode as 10.4u is not on my machine (I have 10.5 and 10.6 on my machine without the "u"). Now I'm sure that I will be able to dig around inside libexternal and point to 10.6 but I don't think that I should have to.

The general state of "externals" surprises me: other high level languages seem to be able to use 3rd party libraries without all this hoopla. If we are stuck with writing wrappers then the documentation needs be updated to a state where the naive user such as myself has a chance. Also why are isn't there a collection of "wrappers" already produced if only to act as a guide for people like me. My project involves attempting to communicate and send commands to a FTDI USB device. The ability to communicate with these devices would be a powerful addition to Livecode yet it seems that these two Scottish companies have yet to meet (FTDI are based in Glasgow).

Can anyone point me to a working tutorial or other documentation that shows how to create a wrapper?

Sorry for the rant - but I have spent two days failing to create a "helloworld" application.... :(

Simon
Attachments
Xcode-snag.png
best wishes
Skids

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2589
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: rnaHello tutorial - Mac Xcode Arggggggg!!!!

Post by mwieder » Tue Mar 20, 2012 6:09 pm

Simon-

I feel your pain here.
Creating an external library for LiveCode is not for the faint of heart. It takes some seriously deep-C coding skills. The fact that you've gotten this far with the v3 externals package is actually quite encouraging. So...

The 10.4 sdk is only necessary if you're building for an Intel/PPC universal binary library. If you don't care about the PPC part you can prune that part out of the XCode project. Unfortunately, that's not quite straightforward. I did this quite a while ago by trial and (lots of) error and then created a template project file which I use for new external projects.

You can go into the XCode project settings and find the10.4 sdk setting, remove it, and then fiex the various errors as they occur. I think that's what I did to get a working project. You can also take the other way out and find the 10.4 sdk on Apple's site (it takes quite a bit of searching to locate this), download it, and point the project's 10.4 setting to that sdk.

The new externals package, when it is finally released, should make things much simpler.

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

Re: rnaHello tutorial - Mac Xcode Arggggggg!!!!

Post by gpb01 » Tue Mar 20, 2012 8:42 pm

Simon Knight wrote: ... omissis ...
When I select build the following error is posted : "error: There is no SDK with the name or path 'Developer/SDKs/MacOSX10.4u.sdk" which I think is part of libexternal, and I have to agree with xcode as 10.4u is not on my machine (I have 10.5 and 10.6 on my machine without the "u").
... omissis ...
Just if you want to try, you can find MacOSX10.4u.sdk inside the xcode_3.0.dmg that you can still download from the Downloads area of Mac OSX developers area (Oct 31, 2007).

Open xcode_3.0.dmg, go inside the 'Packages' folder and, with the 'Pacifist' (... you need him), open the MacOSX10.4Universal.pkg ... inside the folder SDKs finally you can find the MacOSX10.4u.sdk that you can extract into your /Developer/SDKs folder ... :?

Guglielmo

Simon Knight
Posts: 339
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: rnaHello tutorial - Mac Xcode Arggggggg!!!!

Post by Simon Knight » Wed Mar 21, 2012 12:03 am

Hi,

Thanks for the advice and encouragement, I shall keep plugging away at it. I've just dug out a copy of "Cocoa programming for mac OSX" by Hillegass which I hope will shed some light on the mysteries of Xcode......

Good night

Simon
best wishes
Skids

Post Reply

Return to “Building Externals/Plugins”