• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - Delphi 可以为 iOS 创建一个静态库吗?

[复制链接]
菜鸟教程小白 发表于 2022-12-12 18:56:59 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我想在 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:

  • When you build a Delphi package for iOS Device or Android.
  • When you build a Delphi package for a desktop platform and you use the "Generate all C++Builder files (including package libs)" value for the C/C++ Output file generation option in Project > Options > Delphi Compiler > Output - C/C++.
  • When you build a C++ package and you enable the Generate static package library (.lib) option in Project > Options > C++ Linker.

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:

  • <package>.lib for 32-bit Windows.
  • <package>.a for 64-bit Windows and Mac OS X.
  • lib<package>.a for iOS Device and Android.

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

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap