我正在尝试从一个非常简单的库生成一个.gir文件;它基本上是 GLib 文档中的 GObject 示例。使用 g-ir-scanner 时,失败并出现以下错误:
$ g-ir-scanner -I./ --library=foo --library-path=./ --pkg=gobject-2.0 --namespace=Foo -o foo-bar.gir foo-bar.c foo-bar.h
g-ir-scanner: compile: gcc -Wall -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64- linux-gnu/glib-2.0/include -I./ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib- 2.0/include -c -o /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.o /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.c
g-ir-scanner: link: gcc -o /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.o -L. -Wl,-rpath=. - lfoo -L./ -Wl,--export-dynamic -pthread -lgio-2.0 -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
ERROR: can't resolve libraries to shared libraries: foo
我真的不知道出了什么问题。有任何想法吗?