Hot answers tagged

5

To compile Object-C: clang <the file name, i.e. bob.m> -o <the target name, i.e. bob> so clang bob.m -o bob Foundation is part of GNUStep which will have to be installed. sudo apt-get install gnustep You will then need to tell clang about it. clang `gnustep-config --objc-flags` bob.m -o bob `gnustep-config --base-libs`


2

Just completed my article, Cross compilation for Raspberry from Sierra, about exactly this thing. Under Mac OS Sierra though. But for clang it matters a little. In this article I have shared experience (which costed me some days of suffering). Hope it will be useful. In short, all you have to do is to specify rootfs and target triple: path/to/clang --...


2

You need to instal the objective c run time libraries as well as OpenStep/gnuStep if you want to import foundation.h. Objective-c does not come bundled with clang. Apparently you can get gnustep with apt-get: sudo apt-get install gnustep Once that is installed, you should be able to compile against foundation.h


1

Swift does work out of the box on Ubuntu but only on Intel devices, so not on ARM. However, Uraimo has made some scripts to easily build the swift compiler on a raspberry with Raspbian. https://github.com/uraimo/buildSwiftOnARM#building-swift-on-arm


1

I followed this article and it seems to work fine for trivial programs (console/string/math stuff, not many optimization flags). I used ver 1.19 of crosstool-ng on a x86-64 laptop running ZenWalk 7.0 There also seems to be this post over at SO, which might be helpful (haven't fully read thru it yet).


Only top voted, non community-wiki answers of a minimum length are eligible