products
が .library( type: .dynamic )
であることを確認して、 import PackageDescription let package = Package( name: "MyPMLib", products: [ .library( name: "MyPMLib", type: .dynamic, // < HERE targets: ["MyPMLib"]), ], ...
(edited)-l{モジュール名}
$ swift build Compile Swift Module 'MyPMLib' (1 sources) Linking ./.build/x86_64-apple-macosx10.10/debug/libMyPMLib.dylib $ swift -I .build/debug/ -L .build/debug/ -lMyPMLib Welcome to Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.39.1). Type :help for assistance. 1> import MyPMLib 2> hello() Hello? 3>