简体   繁体   English

快速包管理器链接动态库

[英]swift package manager link dynamic lib

i used swift on linux, made the Package.swift file including some libraries, but when i built the project with swift build command, the libraries were static linked with the executable file. 我在Linux上使用swift,制作了Package.swift文件,其中包括一些库,但是当我使用swift build命令构建项目时,这些库与可执行文件是静态链接的。 i tried to generated a Xcode project used the swift package generate-xcodeproj command, built the project in Xcode, then opened the Product directory, i found that the libraries were dynamic linked with the executable file, what did the Xcode doing? 我试图使用swift package generate-xcodeproj命令生成一个Xcode项目,在Xcode中构建该项目,然后打开Product目录,我发现这些库与可执行文件是动态链接的,Xcode在做什么? and how can i build it as a dynamic link use swift build command, could you help me😔😔 以及如何使用swift build命令将其构建为动态链接,您能帮我吗?

SwiftPM version 3 was only able to build executables with statically linked libraries. SwiftPM版本3仅能够使用静态链接库构建可执行文件。 In SwiftPM version 4 (currently in beta, will be released this fall) you can also build with dynamically linked libraries. 在SwiftPM版本4(当前为beta版,将于今年秋天发布)中,您还可以使用动态链接库进行构建。 See SE-0146 for more information. 有关更多信息,请参见SE-0146

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM