OGeek|极客世界-中国程序员成长平台

标题: ios - Delphi 可以为 iOS 创建一个静态库吗? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 18:56
标题: ios - Delphi 可以为 iOS 创建一个静态库吗?

我想在 iOS 应用程序(Xcode 项目)中使用现有的 Pascal 源代码(无用户界面)。所以我需要创建一个静态库,然后我可以将其添加到我的 iOS 项目中。

有没有办法在 Delphi 中为 arm 架构创建静态库 (*.a)?有编译器/链接器选项吗?

或者也许还有其他方法可以做到这一点?

编辑:
我创建了一个 osx 测试项目并使用 Dcp\OSX32 路径中的库文件并手动创建了头文件。

当我构建 Xcode 项目时,我收到以下错误:

ld: warning: ignoring file /Path/lib/testlib.a, file was built for archive which is not the architecture being linked (x86_64): /Path/lib/testlib.a

lipo 说:

lipo -info /Path/lib/testlib.a  fatal error:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo:
> archive with no architecture specification: /Path/lib/testlib.a (can't
> determine architecture for it)

ar:

ar -t /Path/lib/testlib.a  
/  
//  
/1

/Path/lib/teSTLib.a 文件是使用 Delphi 包项目生成的。该文件在 Xcode 项目中似乎不可用。



Best Answer-推荐答案


documentation说这是可能的(我强调)。

RAD Studio generates a package static library file:

A package static library file is a static library file generated from a package. You use a static library in place of an import library when your application does not use run-time packages. See Building Static Packages.

The file name of your package static library file is:

关于ios - Delphi 可以为 iOS 创建一个静态库吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36041536/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4