我如何在 Vala 中使用 C 库?或者如何使用 g-ir-scanner?

How can i use C libraries in Vala? Or how to use g-ir-scanner?

如何在 Vala 中使用 C 库?如写在GNOME documentation, I need to scan my C headers by command line tool g-ir-scanner生成*.GIR文件然后用$ vapigen --library MyLibrary MyLibrary.gir生成VAPI(ValaAPI)文件使用在瓦拉。

除了使用g-ir-scanner,一切都清楚了。如何使用这个工具?

或者没有这个工具如何创​​建绑定?

"g-ir-scanner is made for libraries built with GObject and has to be used in the source code of the library. For other libraries you unfortunately have to create it by hand. It's best to reuse the ones from here https://gitlab.gnome.org/GNOME/vala-extra-vapis but if it's not here you have to make it from scratch" (