[GRASS-dev] porting i.spec.sam to grass7

Vaclav Petras wenzeslaus at gmail.com
Mon Jan 19 08:54:40 PST 2015


On Mon, Jan 19, 2015 at 11:31 AM, Yann Chemin <ychemin at gmail.com> wrote:
>
> Hi,
>
> porting to grass7 i.spec.sam (grass-addons/grass7/imagery/)
>
> I am getting a set of complaints like this:
>
> OBJ.x86_64-unknown-linux-gnu/spec_angle.o:(.bss+0x158): multiple
definition of `Avector'
>
OBJ.x86_64-unknown-linux-gnu/main.o:/home/yann/dev/grass-addons/grass7/imagery/i.spec.sam/main.c:92:
first defined here
>
> while it is actually defined in global.h, and global.h is read in main.c
as well as in spectral_angle.c . The line 92 in main.c is the first
appearance, without declaring Avector (just using it).>

You just miss an "include guard":

 #ifndef GRANDFATHER_H
 #define GRANDFATHER_H

 struct foo {
     int member;
 };

 #endif /* GRANDFATHER_H */

(example from http://en.wikipedia.org/wiki/Include_guard)

Compare:

http://trac.osgeo.org/grass/browser/grass-addons/grass6/imagery/i.spec.sam/global.h?rev=50996
http://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.edge/gauss.h?rev=52501

>
> Yann
> --
> ----
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150119/16beec99/attachment.html>


More information about the grass-dev mailing list