如何在Delphi项目中包含/链接C .lib文件

时间:2023-01-13 10:59:18

We have a .lib file with functionality that must be included in a Delphi application.

我们有一个.lib文件,其功能必须包含在Delphi应用程序中。

It is easy to include .obj files, but for some unknown reason, this won't work for .lib files. The help is not very helpful on this. And a google search did not help that much (most helpful was to use an other linker but I would like to avoid it if possible).

包含.obj文件很容易,但由于某些未知原因,这对.lib文件不起作用。帮助对此没有多大帮助。谷歌搜索没有那么多帮助(最有帮助的是使用其他链接器,但我想尽可能避免它)。

One solution could be using C++ builder to create a package, but I'm not very fond of it.

一种解决方案可能是使用C ++ builder来创建一个包,但我不是很喜欢它。

So the question is, does anybody know a way to include a C .lib file into a Delphi project (so the functionality can be used)? Or is there a way to split the .lib file into .obj files.

所以问题是,是否有人知道将C .lib文件包含到Delphi项目中的方法(因此可以使用该功能)?或者有没有办法将.lib文件拆分为.obj文件。

(By the way we use 2006.

(顺便说一句,我们使用2006年。

1 个解决方案

#1


You can use the tlib.exe tool that comes with C++Builder. If you don't have C++Builder you can download the free C++Compiler 5.5 (http://cc.codegear.com/Free.aspx?id=24778) and use the tlib.exe from it.

您可以使用C ++ Builder附带的tlib.exe工具。如果您没有C ++ Builder,可以下载免费的C ++ Compiler 5.5(http://cc.codegear.com/Free.aspx?id=24778)并使用其中的tlib.exe。

#1


You can use the tlib.exe tool that comes with C++Builder. If you don't have C++Builder you can download the free C++Compiler 5.5 (http://cc.codegear.com/Free.aspx?id=24778) and use the tlib.exe from it.

您可以使用C ++ Builder附带的tlib.exe工具。如果您没有C ++ Builder,可以下载免费的C ++ Compiler 5.5(http://cc.codegear.com/Free.aspx?id=24778)并使用其中的tlib.exe。