1

I am trying to use an old Obj-C static library in a Swift package. I am able to get the package compiling successfully on my mac by using compiler flags in the swift build command. However when running on a Dockerfile running 5.1-xenial the header file's in the static library produce the following error:

#import <Foundation/Foundation.h> "Foundation.h" not found.

As I understand is the because Objective-C foundation library is not available on the machine ? Would I have to install something like GNUstep? Is Swift interoperable with Objective C (I saw that it might not be possible on another SO post) ?

Update on GNUStep approach: I was able to install and run GNUStep allowing for Objective-C development tools (i.e the Linux Foundation framework) alongside Swift however during the swift build I end producing this error:

/usr/GNUstep/Local/Library/Headers/GNUstepBase/GSObjCRuntime.h:92:1: error: expected identifier or '('
@class  NSArray;
^

I think this is because Swift build treats the header file as a purely C library. Any suggestions on fixing this problem ?

0 Answers0