创建自定义小部件 Gtk2/C?

Creating Custom Widget Gtk2/C?

我正在关注一本书(Foundation of Gtk+),当我编译这些文件时:

http://pastebin.com/LagSdYwF

http://pastebin.com/0wNV6Feb

http://pastebin.com/iK0cfMY6

终端输出这个 (gcc ipaddresstest.c $(pkg-config --cflags --libs gtk+-2.0)) :

ipaddresstest.c :(. text + 0xC9): undefined reference to "my_ip_address_new"

ipaddresstest.c :(. text + 0xD2): undefined reference to "my_ip_address_get_type"

ipaddresstest.c :(. text + 0xF6): undefined reference to "my_ip_address_set_address"

/tmp/cclTaXSL.o: in "ip_address_changed" function:

ipaddresstest.c :(. text + 0x183): undefined reference to "my_ip_address_get_address"

collect2: error: ld returned 1 exit status

我什么也没找到。 哪里错了?

PS: 你能告诉我关于 gtk3 的这个参数的指南吗?

您正在引用无法解析的符号。会不会是你在调用gcc的时候没有提到myipaddress.c,里面有函数定义?