-2

无法编译 ac 程序,符号重定义问题。尝试了各种变量数据类型定义,无法理解浮点和静态浮点的情况。给了它一个很好的机会,任何帮助表示赞赏。

克里斯

$ gcc -Wall -g -O6 -I../include -c -o edge.o edge.c

错误信息:

edge.c 的问题:在函数“qc_edge”中:
edge.c:30:15:错误:“内核”重新声明为不同类型的符号
edge.c:23:77:注意:“内核”的先前定义在这里

带有行号的代码片段:

18 //qc_edge (q, scan, start, gap, conv_kernel, 3, 3));
19 }
20
21 /******************************************************************/
22
23 scanbuf *qc_edge (struct qcam *q, scanbuf *scan, int start, int gap, float *kernel, int  
kernel_x, int kernel_y)
24 { scanbuf *scantmp;
25  int i;
26  int s, height, width,
27    grad;
28  float deltaX, deltaY;
29
30 static float kernel [3][3] = {{1, 2, 1},
32                    {2, -1, 2},
33                    {1, 2, 1}};
4

1 回答 1

1
scanbuf *qc_edge (struct qcam *q, scanbuf *scan, int start, int gap, float *kernel, int  
kernel_x, int kernel_y)                                               ^^^^^^^^^^^^// pointer to float type

static float kernel [3][3] = {{1, 2, 1},  array of float.  So you cant have one variable with two declaration in same scope. try changing the variable name. 

尝试:

24 { scanbuf *scantmp;
25  int i;
26  int s, height, width,
27    grad;
28  float deltaX, deltaY;
29
30 static float kernel_temp [3][3] = {{1, 2, 1},  <---- Change name
32                    {2, -1, 2},
33                    {1, 2, 1}};
于 2013-02-23T07:47:45.723 回答