<div dir="ltr"><div><br><br>On Mon, Jan 19, 2015 at 11:31 AM, Yann Chemin <<a href="mailto:ychemin@gmail.com">ychemin@gmail.com</a>> wrote:<br>><br>> Hi,<br>><br>> porting to grass7 i.spec.sam (grass-addons/grass7/imagery/)<br>><br>> I am getting a set of complaints like this:<br>><br>> OBJ.x86_64-unknown-linux-gnu/spec_angle.o:(.bss+0x158): multiple definition of `Avector'<br>> OBJ.x86_64-unknown-linux-gnu/main.o:/home/yann/dev/grass-addons/grass7/imagery/i.spec.sam/main.c:92: first defined here<br>><br>> 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).><br><br>You just miss an "include guard":<br><br> #ifndef GRANDFATHER_H<br> #define GRANDFATHER_H<br>  <br> struct foo {<br>     int member;<br> };<br> <br> #endif /* GRANDFATHER_H */<br><br></div>(example from <a href="http://en.wikipedia.org/wiki/Include_guard">http://en.wikipedia.org/wiki/Include_guard</a>)<br><div><br></div><div>Compare:<br></div><div><br><a href="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/grass6/imagery/i.spec.sam/global.h?rev=50996</a><br><a href="http://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.edge/gauss.h?rev=52501">http://trac.osgeo.org/grass/browser/grass-addons/grass7/imagery/i.edge/gauss.h?rev=52501</a><br> <br>><br>> Yann<br>> --<br>> ----<br>><br>> _______________________________________________<br>> grass-dev mailing list<br>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>> <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br><br></div></div>