gpt4 book ai didi

ios - Delphi 是否可以为 iOS 创建静态库?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:54:12 27 4
gpt4 key购买 nike

我想在 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 -t /Path/lib/testlib.a  
/
//
/1

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

最佳答案

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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com