Why won't this simple LiveCode iOS external compile?

ios, livecode, objective-c, xcode

Solution

This question was asked on a LiveCode listserve and I'm asking and answering here because the answer will be useful for others.

There are a few problems here:

First is the ios file which specifies frameworks and libraries to compile the external against includes Foundation framework yet the use objc-objects clause is not specified in the .lcidl file. If you don't want to use objective c objects then remove the foundation framework from the .ios file.

Second is the file is a .mm which is Objective-C++ and the use c++-naming clause is not specified. If you don't want C++ you can change the .mm to .c for C or .m for Objective-C.

More detail can be found in section 6.3 of the documentation

Problem

I created a simple external using the LiveCode iOS externals SDK. The test.lcidl file is as follows: ``` external test function testMyExternal return boolean ``` The test.mm file is as follows: ``` bool testMyExternal(void) { return true; } ``` The test.ios file is the default Foundation framework. This is about as simple as it gets but it won't compile... why not?

Original source