简体   繁体   English

使用 Lazarus 编写的 FreePascal GUI 应用程序的依赖项是什么?

[英]What are the dependencies of a FreePascal GUI app written with Lazarus?

I know that FreePascal apps for Linux are statically linked.我知道 Linux 的 FreePascal 应用程序是静态链接的。 I imagine that there are some low-level APIs required.我想需要一些低级 API。 Is this just GTK for GUI applications?这只是用于 GUI 应用程序的 GTK 吗? I assume a command-line app wouldn't have the same dependencies.我假设命令行应用程序不会具有相同的依赖项。

Where can I find a way to determine which LCL classes require which underlying APIs?我在哪里可以找到一种方法来确定哪些 LCL 类需要哪些底层 API?

Edit: Vitaly wanted to know what I found with his answer.编辑:维塔利想知道我从他的回答中发现了什么。

With a small console app: ldd confirmed that it was a statically linked executable.使用一个小的控制台应用程序:ldd 确认它是一个静态链接的可执行文件。
strace was more interesting. strace 更有趣。 A console-only application showed no open files.仅限控制台的应用程序显示没有打开的文件。 I guess it's totally self contained.我想它是完全自给自足的。

With a simple GUI application, ldd showed some dynamic linking, and strace's output showed many "open"s.通过一个简单的 GUI 应用程序,ldd 显示了一些动态链接,而 strace 的输出显示了许多“打开”。

It'll still take a little more research before I'm comfortable with this.在我对此感到满意之前,还需要进行更多的研究。

Since they are statically linked, exactly what kind of dependencies could they have?..既然它们是静态链接的,那么它们究竟可以有什么样的依赖关系?..

However you can try to work it out with a several methods...但是,您可以尝试使用多种方法来解决它...

  1. ldd <executable> (just to be sure that your binary is not dynamically linked) ldd <executable> (只是为了确保您的二进制文件不是动态链接的)
  2. strace <executable> > log.file 2&>1 && cat log.file | grep open

Where can I find a way to determine which LCL classes require which underlying APIs?我在哪里可以找到一种方法来确定哪些 LCL 类需要哪些底层 API?

From my point of view, this purpose requires some hard work.在我看来,这个目的需要一些艰苦的工作。 I'd advice to try systemtap for the one.我建议您尝试使用systemtap

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM