C中未声明的标识符

时间:2010-09-22 01:45:22

标签: c linux kernel printer-control-language

我一直在尝试编译一个使用PCL的程序。但是,我一直收到这个错误:

test.c:23: error: ‘PCL_CNT_TYPE’ undeclared (first use in this function)
test.c:23: error: (Each undeclared identifier is reported only once
test.c:23: error: for each function it appears in.)
test.c:23: error: expected ‘;’ before ‘i_result_list1’
test.c:24: error: ‘PCL_FP_CNT_TYPE’ undeclared (first use in this function)
test.c:24: error: expected ‘;’ before ‘fp_result_list1’
test.c:27: error: ‘PCL_L1DCACHE_MISS’ undeclared (first use in this function)
test.c:28: error: ‘PCL_L2CACHE_MISS’ undeclared (first use in this function)
test.c:30: error: ‘PCL_MODE_USER’ undeclared (first use in this function)
test.c:33: error: ‘PCL_SUCCESS’ undeclared (first use in this function)
test.c:47: error: ‘i_result_list2’ undeclared (first use in this function)
test.c:47: error: ‘fp_result_list2’ undeclared (first use in this function)

任何想法为什么?

我在我的机器上安装了libpcl1 {-dev},所以我想知道还有什么方法可以让它工作。

如果您需要进一步信息,请告诉我。

感谢。

1 个答案:

答案 0 :(得分:2)

把:

#include <pcl.h>

位于文件顶部。链接时您还需要-lpcl。 E.g:

gcc program.c -lpcl -o program