I am trying to import a framework into the Swift REPL, with the following syntax:
$ swift -F path/to/my/Build/Products/Debug
Where testFramework.framework
is in Build/Products/Debug
.
Then I can successfully import it, like so:
1> import testFramework
But when I try to use it (say here I instantiate an object called Action
), I get a "Couldn't lookup symbols" error:
2> let action = Action(address: "localhost", port: 50051)
action: testFramework.Action = <extracting data from value failed>
error: Couldn't lookup symbols:
__T013testFramework6ActionCACSS7address_Si4porttcfC
__T013testFramework6ActionCMa
However, if I nm testFramework/testFramework
, I can find this symbol:
00000000001d8990 T __T013testFramework6ActionCACSS7address_Si4porttcfC
Why is that? testFramework
looks like this:
├── Headers -> Versions/Current/Headers
├── Modules -> Versions/Current/Modules
├── Resources -> Versions/Current/Resources
├── Versions
│ ├── A
│ │ ├── Headers
│ │ │ ├── testFramework-Swift.h
│ │ │ └── testFramework.h
│ │ ├── Modules
│ │ │ ├── module.modulemap
│ │ │ └── testFramework.swiftmodule
│ │ │ ├── x86_64.swiftdoc
│ │ │ └── x86_64.swiftmodule
│ │ ├── Resources
│ │ │ └── Info.plist
│ │ ├── _CodeSignature
│ │ │ └── CodeResources
│ │ └── testFramework
│ └── Current -> A
└── testFramework -> Versions/Current/testFramework