2013-03-29 57 views
2

我正在编译一些名为libfprint的软件。我已经成功地编译到另一台机器上,但现在却在许多文件,我得到以下错误:错误:隐式声明函数'g_slist_free_full'

[email protected]:~/Documents/FingerBellProject/libfprint-0.5.0$ sudo make 
[sudo] password for tomselleck: 
make all-recursive 
make[1]: Entering directory `/home/tomselleck/Documents/FingerBellProject/libfprint-0.5.0' 
Making all in libfprint 
make[2]: Entering directory `/home/tomselleck/Documents/FingerBellProject/libfprint-0.5.0/libfprint' 
    CC  libfprint_la-aes1610.lo 
drivers/aes1610.c: In function 'capture_read_strip_cb': 
drivers/aes1610.c:619: error: implicit declaration of function 'g_slist_free_full' 
make[2]: *** [libfprint_la-aes1610.lo] Error 1 
make[2]: Leaving directory `/home/tomselleck/Documents/FingerBellProject/libfprint-0.5.0/libfprint' 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory `/home/tomselleck/Documents/FingerBellProject/libfprint-0.5.0' 
make: *** [all] Error 2 

任何想法?谢谢 !

编辑

我会后它在抛出一个错误的行的例子:

/* stop capturing if MAX_FRAMES is reached */ 
    if (aesdev->blanks_count > 10 || g_slist_length(aesdev->strips) >= MAX_FRAMES) { 
     struct fp_img *img; 

     fp_dbg("sending stop capture.... blanks=%d frames=%d", aesdev->blanks_count, g_slist_length(aesdev->strips)); 
     /* send stop capture bits */ 
     aes_write_regv(dev, capture_stop, G_N_ELEMENTS(capture_stop), stub_capture_stop_cb, NULL); 
     aesdev->strips = g_slist_reverse(aesdev->strips); 
     img = aes_assemble(aesdev->strips, aesdev->strips_len, 
      FRAME_WIDTH, FRAME_HEIGHT); 

     g_slist_free_full(aesdev->strips, g_free);<---- Error here 

     aesdev->strips = NULL; 
     aesdev->strips_len = 0; 
     aesdev->blanks_count = 0; 
     fpi_imgdev_image_captured(dev, img); 
     fpi_imgdev_report_finger_status(dev, FALSE); 
     /* marking machine complete will re-trigger finger detection loop */ 
     fpi_ssm_mark_completed(ssm); 
     /* Acquisition finished: restore default gain values */ 
     restore_gain(); 
    } else { 
     /* obtain next strip */ 
     fpi_ssm_jump_to_state(ssm, CAPTURE_REQUEST_STRIP); 
    } 

out: 
    g_free(data); 
    libusb_free_transfer(transfer); 
} 

回答

3

这种情况发生时

  • 第一次使用该功能先于它的定义,
  • 没有功能原型,或者
  • 缺少必需的头文件。

确保在文本或标题中有原型,或者在第一次使用之前将函数移到文件的前面。

+0

对不起,我不是很确定你的意思,我不太了解c ...我正在编译这个,然后将它封装在一个java包装器中。 – TomSelleck

+1

@Tomcelic在源文件中查找'g_slist_free_full'函数的位置。应该有两个地方 - 一个在.h文件中,另一个在C/CPP文件中。确保.h文件是#include' -d,在您看到错误的源文件的顶部。 – dasblinkenlight

0

...(括号内)不要运行make作为root用sudo。这部分是因为人们可以想象在构建过程中破坏某些重要事物(根本不会阻止)的某些事情,以及一般性原则,即尽可能少地根源。

如果你确实在系统的位置,如/usr/local安装的东西,如建立自己的,然后做make -n install,并检查了什么事情安装位置(假设你正在构建的东西有一个安装目标)。如果一切看起来都OK,那么只能做sudo make install

相关问题