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

2015-01-19 Thread Markus Neteler
On Jan 19, 2015 7:13 PM, "Yann Chemin"  wrote:
>
> Seems to be the last hurdle..
> ogr_api.h
> 
> In file included from
/home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vect/digit.h:3:0,
>  from
/home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vector.h:4,
>  from main.c:27:
>
/home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vect/dig_structs.h:27:21:
fatal error: ogr_api.h: No such file or directory
>  #include 
>  ^
> compilation terminated.

See the last line in this fix

https://trac.osgeo.org/grass/changeset/64242

... one more include you need.

Markus

> --
>
>
>
>
> On 19 January 2015 at 22:31, Markus Neteler  wrote:
>>
>> On Mon, Jan 19, 2015 at 5:31 PM, Yann Chemin  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).
>>
>> [neteler@pgis_north i.spec.sam]$ grep Avector *.h
>> global.h:GLOBAL VEC *b, *Avector;
>>
>> I guess the GLOBAL declarations need to be fixed as time ago in other
>> GRASS modules using "extern". See for example:
>>
>> http://trac.osgeo.org/grass/changeset/32675/grass/trunk/raster/r.to.vect
>>
>> Markus
>
>
>
>
> --
> 
>
> ___
> grass-dev mailing list
> grass-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

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

2015-01-19 Thread Markus Neteler
(the mail from my mobile isn't yet here, so I try again)

On Mon, Jan 19, 2015 at 7:13 PM, Yann Chemin  wrote:
> Seems to be the last hurdle..
> ogr_api.h
> 
> In file included from
> /home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vect/digit.h:3:0,
>  from
> /home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vector.h:4,
>  from main.c:27:
> /home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vect/dig_structs.h:27:21:
> fatal error: ogr_api.h: No such file or directory
>  #include 
>  ^
> compilation terminated.
> --

You need to add in the Makefile:

EXTRA_INC = $(PROJINC)

Markus
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev


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

2015-01-19 Thread Yann Chemin
Seems to be the last hurdle..
ogr_api.h

In file included from
/home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vect/digit.h:3:0,
 from
/home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vector.h:4,
 from main.c:27:
/home/yann/dev/grass_yann/dist.x86_64-unknown-linux-gnu/include/grass/vect/dig_structs.h:27:21:
fatal error: ogr_api.h: No such file or directory
 #include 
 ^
compilation terminated.
--




On 19 January 2015 at 22:31, Markus Neteler  wrote:

> On Mon, Jan 19, 2015 at 5:31 PM, Yann Chemin  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).
>
> [neteler@pgis_north i.spec.sam]$ grep Avector *.h
> global.h:GLOBAL VEC *b, *Avector;
>
> I guess the GLOBAL declarations need to be fixed as time ago in other
> GRASS modules using "extern". See for example:
>
> http://trac.osgeo.org/grass/changeset/32675/grass/trunk/raster/r.to.vect
>
> Markus
>



-- 

___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

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

2015-01-19 Thread Markus Neteler
On Mon, Jan 19, 2015 at 5:31 PM, Yann Chemin  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).

[neteler@pgis_north i.spec.sam]$ grep Avector *.h
global.h:GLOBAL VEC *b, *Avector;

I guess the GLOBAL declarations need to be fixed as time ago in other
GRASS modules using "extern". See for example:

http://trac.osgeo.org/grass/changeset/32675/grass/trunk/raster/r.to.vect

Markus
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev


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

2015-01-19 Thread Vaclav Petras
On Mon, Jan 19, 2015 at 11:31 AM, Yann Chemin  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@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

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

2015-01-19 Thread Yann Chemin
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).

Yann
-- 

___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev