错误:
方法一
在test.c中定义
//test.c
......
struct pdesc const cameractrl_params[] = {
{PT_STRI_, 0, 1, OFFSET(cameractrl, homecmd), "homecmd", 32, 0, NULL, NULL},
{PT_STRI_, 0, 1, OFFSET(cameractrl, zoomctrl), "zoomctrl", 32, 0, NULL, NULL},
{PT_STRI_, 0, 1, OFFSET(cameractrl, focusctrl), "focusctrl", 32, 0, NULL, NULL},
{PT_STRI_, 0, 1, OFFSET(cameractrl, aperturectrl), "aperturectrl", 32, 0, NULL, NULL},
{PT_NULL_, 0, 0, 0, "", 0, 0, NULL, NULL} /* PT_NULL means tail of struct pdesc array */
};
......
在test.h中定义
//test.h
#ifndef _TEST_H_
#define _TEST_H_
......
extern struct pdesc const cameractrl_params[];
......
#endif
方法二
在test.h头文件中
变量前加static关键字