我在Raspberry上使用Zbar来编写san qrcode但是有一些问题

时间:2015-05-07 03:03:00

标签: c linux zbar

我在Raspberry上安装了zbar库和gtk库,但是当我编译zbar提供的示例zbargtk.c时,它无法编译。 我使用的命令是gcc -o testgtk testgtk.c pkg-config --libs --cflags gtk+-2.0 zbar

我花了三天时间来解决这个问题,但我无法解决。 以下是我得到的错误:

pi@raspberrypi ~/Desktop $ gcc -o testgtk testgtk.c `pkg-config --libs --cflags gtk+-2.0 zbar`
testgtk.c: In function ‘main’:
testgtk.c:149:5: warning: ‘g_thread_init’ is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:261) [-Wdeprecated-declarations]
/tmp/ccF6LqbT.o: In function `video_enabled':
testgtk.c:(.text+0x12c): undefined reference to `zbar_gtk_get_type'
testgtk.c:(.text+0x148): undefined reference to `zbar_gtk_get_video_enabled'
testgtk.c:(.text+0x154): undefined reference to `zbar_gtk_get_video_opened'
/tmp/ccF6LqbT.o: In function `video_opened':
testgtk.c:(.text+0x1dc): undefined reference to `zbar_gtk_get_type'
testgtk.c:(.text+0x1f8): undefined reference to `zbar_gtk_get_video_opened'
testgtk.c:(.text+0x204): undefined reference to `zbar_gtk_get_video_enabled'
/tmp/ccF6LqbT.o: In function `video_changed':
testgtk.c:(.text+0x2b8): undefined reference to `zbar_gtk_get_type'
testgtk.c:(.text+0x300): undefined reference to `zbar_gtk_set_video_device'
/tmp/ccF6LqbT.o: In function `status_button_toggled':
testgtk.c:(.text+0x320): undefined reference to `zbar_gtk_get_type'
testgtk.c:(.text+0x33c): undefined reference to `zbar_gtk_get_video_opened'
testgtk.c:(.text+0x348): undefined reference to `zbar_gtk_get_video_enabled'
testgtk.c:(.text+0x378): undefined reference to `zbar_gtk_get_type'
testgtk.c:(.text+0x398): undefined reference to `zbar_gtk_set_video_enabled'
/tmp/ccF6LqbT.o: In function `open_button_clicked':
testgtk.c:(.text+0x55c): undefined reference to `zbar_gtk_get_type'
testgtk.c:(.text+0x57c): undefined reference to `zbar_gtk_scan_image'
/tmp/ccF6LqbT.o: In function `main':
testgtk.c:(.text+0x620): undefined reference to `g_thread_init'
testgtk.c:(.text+0x708): undefined reference to `zbar_gtk_new'
testgtk.c:(.text+0x920): undefined reference to `scan_video'
collect2: ld returned 1 exit status

0 个答案:

没有答案