ios - Delphi 可以为 iOS 创建一个静态库吗?
<p><p>我想在 iOS 应用程序(Xcode 项目)中使用现有的 Pascal 源代码(无用户界面)。所以我需要创建一个静态库,然后我可以将其添加到我的 iOS 项目中。 </p>
<p>有没有办法在 Delphi 中为 arm 架构创建静态库 (*.a)?有编译器/链接器选项吗?</p>
<p>或者也许还有其他方法可以做到这一点?</p>
<p><strong>编辑:</strong><br/>
我创建了一个 osx 测试项目并使用 Dcp\OSX32 路径中的库文件并手动创建了头文件。 </p>
<p>当我构建 Xcode 项目时,我收到以下错误:</p>
<blockquote>
<p>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</p>
</blockquote>
<p>lipo 说:</p>
<pre><code>lipo -info /Path/lib/testlib.afatal 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)
</code></pre>
<p>ar:</p>
<pre><code>ar -t /Path/lib/testlib.a
/
//
/1
</code></pre>
<p>/Path/lib/teSTLib.a 文件是使用 Delphi 包项目生成的。该文件在 Xcode 项目中似乎不可用。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p><a href="http://docwiki.embarcadero.com/RADStudio/en/Package_Static_Library_File" rel="noreferrer noopener nofollow">documentation</a>说这是可能的(我强调)。</p>
<blockquote>
<p>RAD Studio generates a package static library file:</p>
<ul>
<li><strong>When you build a Delphi package for iOS Device or Android.</strong></li>
<li>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++.</li>
<li>When you build a C++ package and you enable the Generate static package library (.lib) option in Project > Options > C++ Linker.</li>
</ul>
<p>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.</p>
<p>The file name of your package static library file is:</p>
<ul>
<li><code><package>.lib</code> for 32-bit Windows.</li>
<li><code><package>.a</code> for 64-bit Windows and Mac OS X.</li>
<li><strong><code>lib<package>.a</code> for iOS Device and Android.</strong></li>
</ul>
</blockquote></p>
<p style="font-size: 20px;">关于ios - Delphi 可以为 iOS 创建一个静态库吗?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/36041536/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/36041536/
</a>
</p>
页:
[1]