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

rabotin rabotin at supagro.inra.fr
Wed May 26 11:30:53 EDT 2010


Thanks for helping me,
as you wrote I change
> 	std::cout << &driver << std::endl;
>   
to:


> 	std::cout << driver << std::endl;
And I got a zero value return . So my driver isn't set ?
Is the problem from the following lines :
setenv("DBF_DRIVER","dbf",1);
setenv("DB_DATABASE","$GISDBASE/$LOCATION_NAME/$MAPSET/dbf",1);

I didn't write but I use grass 6.4 on ubuntu 9.10.
Do you know other commands to test or to set the dbf driver than 
db_start_driver command ?

Cheers

Mick




Glynn Clements a écrit :
> rabotin wrote:
>
>   
>> After that , using db_open_database(driver,&handle) command launch a
>> segmentation fault. Is it because my handle is a null value ?
>>     
>
> Possibly; change:
>
>   
>> 	std::cout << &driver << std::endl;
>>     
>
> to:
>
>   
>> 	std::cout << driver << std::endl;
>>     
>
> to confirm this.
>
>   
>> Are some commands missing to access or start dbf driver in my script ?
>>     
>
> I can't see anything wrong, other than failing to check the return
> value from db_start_driver().
>
>   


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

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