我对图形编程不是很有经验,但我很好奇。我在我的Debian10.7机器上安装了libgtk-3-dev和gtk-3-示例。在这里,我列出了使用dpkg-query -L gtk-3-examples查找一些示例程序的示例包文件。
在示例目录中,我找到了以下自述文件:
== Building the examples ==
The examples in this directory are built alongside the rest of GTK+.
The examples under the `application[1-10]` directories are also included in
the GTK+ API reference documentation, and can be built independently, using
the system libraries, by doing:
$ cd application1
$ make -f Makefile.example往前看。但是,按照这些指示准确地得到以下结果:
make: Makefile.example: No such file or directory
make: *** No rule to make target 'Makefile.example'. Stop.应用程序文件夹中没有"Makefile.example“文件。在示例目录中运行find -name "Makefile*"将产生以下结果:
./application7/Makefile.in.gz
./application7/Makefile.am
./Makefile.in.gz
./application5/Makefile.in.gz
./application5/Makefile.am
./bp/Makefile.in.gz
./bp/Makefile.am
./application9/Makefile.in.gz
./application9/Makefile.am
./application6/Makefile.in.gz
./application6/Makefile.am
./application2/Makefile.in.gz
./application2/Makefile.am
./application10/Makefile.in.gz
./application10/Makefile.am
./application3/Makefile.in.gz
./application3/Makefile.am
./application1/Makefile.in.gz
./application1/Makefile.am
./application8/Makefile.in.gz
./application8/Makefile.am
./application4/Makefile.in.gz
./application4/Makefile.am
./Makefile.am我没有任何运气来构建一个使用上述文件的示例程序。我猜是因为我对汽车工具不熟悉吧?是否有一种使用上述文件构建示例GTK程序的简单方法,或者我是否需要了解更多有关make/autotools/configure的知识才能运行一个工作示例?
更新:
cant-run-makefile-am-what-should-i-do帖子内容丰富,但在包中找不到配置、引导或自动生成程序时,不提供操作过程。以下命令在我的示例目录中执行时不会产生任何结果:find -type f | grep -i -E "*conf*|*auto*|*boot*"。我需要这些文件之一提供,以便有一个成功的构建(据我所理解,无论如何)。
发布于 2021-02-22 02:38:26
抱歉这么大惊小怪!我已经习惯了安装常规的软件包,我错过了需要下载完整的源代码才能让示例正常工作的想法。所以,我最初提到我安装了libgtk-3-dev和gtk-3-示例。我使用的是apt-get install libgtk-3-dev && apt-get install gtk-3-examples。
但是,要在本地构建GTK及其示例,您想要做的是使用apt-get source gtk-3-examples (或类似的)获取源代码包存档。我想当我运行这个命令时,它实际上为我选择了一个不同的元包)。
然后,在我的新gtk+3.0-3.24.5目录中,我可以运行一个很好的配置二进制文件(使用后续的make和make install命令),它生成许多文件,包括示例程序二进制文件。
因此,对于./gtk+3.0-3.24.5/examples/application1/exampleapp,我得到了一个运行示例。瞧!

https://stackoverflow.com/questions/66302177
复制相似问题