Buliding a C/C++ external for LiveCode 9.01 and Xcode 10
Posted: Mon Oct 08, 2018 12:32 am
Hello LiveCode community!
I've taken over maintenance for an old LiveCode application which uses a custom external library written in C. The application is no longer working with recent platform and I'm reasonably sure that complications with the external are to blame. I'm new to LiveCode and don't use Xcode frequently.
I decided to build a simple external using the most recent LiveCode documentation I could find (from Nov 2006):
http://newsletters.livecode .com/november/issue13/newsletter5.php
As i386 architectures are no longer supported, I've removed the PowerPC-32 and x86-32 from all Xcode project build target configurations, and i386 from the list of valid architectures. These changes allow the project to build in Xcode properly.
Xcode 10 doesn't seem to have the same interface referenced by the old article for building in release mode. To perform the initial step of building in Release configuration, I have run Product > Archive from the menu.
When I then 'Run' the project, making sure the the build configuration from the 'manage schemes' interface is 'Debug', the LiveCode test stack rnaHelloStack.rev doesn't open automatically. I am able to make that happen by defining the LiveCode Indy 9.0.1.app executable for the scheme and EITHER:
1) Defining the working directory in the scheme options AND passing the rnaHelloStack.rev as an argument. 2) Choosing the Launch option for the scheme to 'Wait for executable to be launched' and opening the rnaHelloTest.rev file directly from the Finder after running the project.
In all cases, when the rnaHelloTest.rev is opened in LiveCode and I add the button handler script, the code halts execution at the call to the external function.
I have tinkered with the LiveCode code and variables. My best guess is that the external is not properly loaded into the stack. I've scoured for more recent documentation but have found nothing except this old forum post trying a similar thing:
https://forums.livecode .com/viewtopic.php?f=17&t=11295&sid=380a6fe4b12111f767fc863262a3acf9
How can I assure a simple external like this from the documentation is available to a LiveCode stack via the updated LiveCode 9.0.1 IDE and XCode 10?
Thank you,
Aaron
P.S. I also posted this question on StackOverflow, but decided the experts here might be a better source of help.
https://stackoverflow .com/questions/52692585/building-a-c-c-external-for-livecode-9-01-with-xcode-10
I've taken over maintenance for an old LiveCode application which uses a custom external library written in C. The application is no longer working with recent platform and I'm reasonably sure that complications with the external are to blame. I'm new to LiveCode and don't use Xcode frequently.
I decided to build a simple external using the most recent LiveCode documentation I could find (from Nov 2006):
http://newsletters.livecode .com/november/issue13/newsletter5.php
As i386 architectures are no longer supported, I've removed the PowerPC-32 and x86-32 from all Xcode project build target configurations, and i386 from the list of valid architectures. These changes allow the project to build in Xcode properly.
Xcode 10 doesn't seem to have the same interface referenced by the old article for building in release mode. To perform the initial step of building in Release configuration, I have run Product > Archive from the menu.
When I then 'Run' the project, making sure the the build configuration from the 'manage schemes' interface is 'Debug', the LiveCode test stack rnaHelloStack.rev doesn't open automatically. I am able to make that happen by defining the LiveCode Indy 9.0.1.app executable for the scheme and EITHER:
1) Defining the working directory in the scheme options AND passing the rnaHelloStack.rev as an argument. 2) Choosing the Launch option for the scheme to 'Wait for executable to be launched' and opening the rnaHelloTest.rev file directly from the Finder after running the project.
In all cases, when the rnaHelloTest.rev is opened in LiveCode and I add the button handler script, the code halts execution at the call to the external function.
I have tinkered with the LiveCode code and variables. My best guess is that the external is not properly loaded into the stack. I've scoured for more recent documentation but have found nothing except this old forum post trying a similar thing:
https://forums.livecode .com/viewtopic.php?f=17&t=11295&sid=380a6fe4b12111f767fc863262a3acf9
How can I assure a simple external like this from the documentation is available to a LiveCode stack via the updated LiveCode 9.0.1 IDE and XCode 10?
Thank you,
Aaron
P.S. I also posted this question on StackOverflow, but decided the experts here might be a better source of help.
https://stackoverflow .com/questions/52692585/building-a-c-c-external-for-livecode-9-01-with-xcode-10