我想在 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-推荐答案 strong>
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/
|