[GRASS-user] Setting GRASS environment variable in a C program - step two

rabotin rabotin at supagro.inra.fr
Fri May 28 03:46:16 EDT 2010


It finally works !
For information, the issue was here
setenv("GISBASE","/usr/lib/grass64/dist.i486-pc-linux-gnu",0);

I replace by this following line
setenv("GISBASE","/usr/lib/grass64/",0);
and it works

Thanks again for your help Glynn


Michael Rabotin

Glynn Clements a écrit :
> rabotin wrote:
>
>   
>> If (inside a GRASS session), I access with  v.db.connect -p map=GU0507
>> it looks ok :
>>
>> Vector map <GU0507 at simon9> is connected by:
>> layer <1> table <GU0507> in database 
>> </home/rabotin/grassdata/Roujan/simon9/dbf/> through driver <dbf> with 
>> key <cat>
>>
>> Do you know how to launch a grass command (e.g. v.db.connect) inside a C 
>> script
>> I try this line in my C progam
>>
>> system(v.db.connect -p map=GU0507)
>>
>> but I have an error message
>>
>> sh: v.db.connect: not found
>>     
>
> That indicates the $GISBASE/bin isn't in $PATH.
>
> For a list of envionment variables which may be useful, I suggest
> reading this:
>
> http://grass.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly
>
>   


-- 
*********************************

Michaël Rabotin
Ingénieur d'étude en géomatique

Laboratoire d'étude des Interactions Sol, Agrosystème et Hydrosystème
UMR LISAH SupAgro-INRA-IRD
Bat. 24
2 place Viala
34060 Montpellier cedex 1 
FRANCE

Téléphone :  33 (0)4 99 61 23 85
Secrétariat : 33 (0)4 99 61 22 61
Fax : 33 (0)4 67 63 26 14
E-mail : rabotin at supagro.inra.fr

*********************************



More information about the grass-user mailing list