Thank you for answering :)<br>
<br>
So let me see if I understood : you can only use GRASS 's GIS library
and such in grass environnment, after launching it ($ grass).<br><br>
There is no way (besides SWIG) that I can use GRASS's structure and
abilities for a specific purpose program without launching GRASS ? I
mean, everytime I want touse GIS library I have t launch GRASS ?<br>
<br>
Thanks.<br>
<br><div><span class="gmail_quote">2006/3/28, Markus Neteler <<a href="mailto:neteler@itc.it">neteler@itc.it</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
To run GRASS *commands* from outside, take a look at the SWIG interface.<br>It is only prototype, but looks promising:<br><br> <a href="http://grass.itc.it/devel/index.php#prog">http://grass.itc.it/devel/index.php#prog</a>
<br> -> GRASS SWIG interface <<a href="http://mpa.itc.it/markus/grass61progman/swig/">http://mpa.itc.it/markus/grass61progman/swig/</a>><br><br>Markus<br><br>Ana Soares wrote:<br><br>> Hi :-)<br>><br>><br>
> It compiles. But this I don't understand : it runs in grass but not in<br>> standard shell session<br>><br>> GRASS 6.0.1 (spearfish60):~/Estagio/GRASS_Prototipo1 > ./prot1<br>> Argv[0] = ./prot1<br>> G_program_name => prot1
<br>> GRASS 6.0.1 (spearfish60):~/Estagio/GRASS_Prototipo1 ><br>><br>><br>> this I don't uderstand<br>> So I can't use its GIS library and so on without entering grass ?<br>><br>><br>><br>><br>
><br>><br>><br>> 2006/3/28, marcos boullón magán <<a href="mailto:marcosboullon@gmail.com">marcosboullon@gmail.com</a><br>> <mailto:<a href="mailto:marcosboullon@gmail.com">marcosboullon@gmail.com</a>
>>:<br>><br>> But your code DOES compile (pointing to the gis.h file)...<br>><br>> marcos@venux:~/cvsgrass/devel/tmp$ cat prot1.c<br>> #include <stdio.h><br>> #include <unistd.h
><br>> #include <stdlib.h><br>> #include "../../grass6/include/gis.h"<br>> int main(int argc, char **argv) {<br>> printf("Argv[0] = %s\n", argv[0]) ;<br>> G_gisinit("prot1") ;
<br>> printf("G_program_name => %s\n", G_program_name()) ;<br>> }<br>><br>> marcos@venux:~/cvsgrass/devel/tmp$ mkdir OBJ.i686-pc-linux-gnu<br>><br>> marcos@venux:~/cvsgrass/devel/tmp$ gcc
<br>> -I/home/marcos/cvsgrass/grass6/dist.i686-pc-linux-gnu/include -g -O2<br>> -Wall -Wconversion -Wno-implicit-int -DPACKAGE=\""grassmods"\"<br>> -I/home/marcos/cvsgrass/grass6/dist.i686-pc-linux-gnu/include -o
<br>> OBJ.i686-pc-linux-gnu/prot1.o -c prot1.c<br>> prot1.c: En la función `main':<br>> prot1.c:23: aviso: control reaches end of non-void function<br>><br>> marcos@venux :~/cvsgrass/devel/tmp$ gcc
<br>> -L/home/marcos/cvsgrass/grass6/dist.i686-pc-linux-gnu/lib<br>> -Wl,--export-dynamic<br>> -Wl,-rpath-link,/home/marcos/cvsgrass/grass6/dist.i686-pc-linux-gnu/lib<br>> -DPACKAGE=\""grassmods"\" -o
<br>> /home/marcos/cvsgrass/grass6/dist.i686-pc-linux-gnu/bin/prot1<br>> OBJ.i686-pc-linux-gnu/prot1.o -lgrass_gis -lgrass_datetime -lz<br>> -lgrass_segment -lm -lz<br>><br>> marcos@venux:~/cvsgrass/devel/tmp$ dir
<br>> /home/marcos/cvsgrass/grass6/dist.i686-pc-linux-gnu/bin/prot1<br>> -rwxr-xr-x 1 marcos marcos 32173 2006-03-28 13:26<br>> /home/marcos/cvsgrass/grass6/dist.i686-pc-linux-gnu/bin/prot1<br>><br>
><br>> ... and also DOES work under GRASS...<br>><br>> marcos@venux:~/cvsgrass/devel/tmp$ grass61<br>> [...]<br>><br>> GRASS 6.1.cvs (spearfish60):~/cvsgrass/devel/tmp ><br>> ../../grass6/dist.i686-pc-linux-gnu/bin/prot1
<br>> Argv[0] = ../../grass6/dist.i686-pc-linux-gnu/bin/prot1<br>> G_program_name => prot1<br>><br>><br>> Just remember, you need a succesfully GRASS install to be able to<br>> compile your own code.
<br>><br>> M.<br>><br>> 2006/3/28, Ana Soares <<a href="mailto:tiobrothercamarada@gmail.com">tiobrothercamarada@gmail.com</a><br>> <mailto:<a href="mailto:tiobrothercamarada@gmail.com">tiobrothercamarada@gmail.com
</a>>>:<br>> ><br>> > Noooo! :-S<br>> ><br>> > As I've show in the output....<br>> ><br>> ><br>> > 28 Mar 2006 10:47:19 -0000, Nitin <<a href="mailto:grasschoper@rediffmail.com">
grasschoper@rediffmail.com</a><br>> <mailto:<a href="mailto:grasschoper@rediffmail.com">grasschoper@rediffmail.com</a>>>:<br>> > ><br>> > ><br>> > ><br>> > >
<br>> > > problem solved?<br>> > ><br>> > ><br>> > > On Tue, 28 Mar 2006 Ana Soares wrote :<br>> > ><br>> > > >28 Mar 2006 10:29:53 -0000, No Name
<br>> <<a href="mailto:grasschoper@rediffmail.com">grasschoper@rediffmail.com</a> <mailto:<a href="mailto:grasschoper@rediffmail.com">grasschoper@rediffmail.com</a>>>:<br>> > > > ><br>
> > > > ><br>> > > > > check path of "gis.h " in ur makefile and don't forget to<br>> link gis<br>> > > > > library.<br>> > ><br>> > > > >
<br>> > > > ><br>> > > > ><br>> > > > > On Tue, 28 Mar 2006 Ana Soares wrote :<br>> > > > > >Hei :-)<br>> > > > > >
<br>> > > > > >I already did that.<br>> > > > > ><br>> > > > > >My problem is how to integrate that in a program of my own.<br>> > > > > >For example,
<br>> > > > > ><br>> > > > > >#include < stdio.h><br>> > > > > ><br>> > > > > >#include "interface.h"<br>> > > > > >#include <
unistd.h><br>> > > > > >#include <stdlib.h><br>> > > > > ><br>> > > > > >#include "gis.h"<br>> > > > > ><br>> > > > > >
<br>> > > > > >int main(int argc, char **argv) {<br>> > > > > ><br>> > > > > > printf("Argv[0] = %s\n", argv[0]) ;<br>> > > > > >
<br>> > > > > > G_gisinit("prot1") ;<br>> > > > > ><br>>
> > > > > printf("G_program_name
=> %s\n", G_program_name()) ;<br>> > > > > ><br>> > > > > > // if (G_parser(argc, argv))<br>> > > > > > //exit (-1);<br>> > > > > >
<br>> > > > > > // ask_interface() ;<br>> > > > > ><br>> > > > > >}<br>> > > > > ><br>> > > > > >I don 't understant why this doesn't work :-(
<br>> > > > > ><br>> > > > > >Output :<br>> > > > > >seabiscuit@ubuntu:~/Estagio/GRASS_Prototipo1$ ./prot1<br>> > > > > >Argv[0] = ./prot1
<br>> > > > > ><br>> > > > > >bla<br>> > > > > ><br>> > > > > ><br>> > > > > ><br>> > > > > >
<br>> > > > > ><br>> > > > > ><br>> > > > > ><br>> > > > > ><br>> > > > > ><br>> > > > > >
<br>> > > > > ><br>> > > > > ><br>> > > > > ><br>> > > > > >seabiscuit@ubuntu:~/Estagio/GRASS_Prototipo1$<br>> > > > > >
<br>> > > > > >(this stopped because I did Ctr C)<br>> > > > > ><br>> > > > > >This is what I'm having trouble understanding ....<br>> > > > > >Help please :-)
<br>> > > > > ><br>> > > > > ><br>> > > > > ><br>> > > > > >28 Mar 2006 10:08:10 -0000, No Name <<br>> <a href="mailto:grasschoper@rediffmail.com">
grasschoper@rediffmail.com</a> <mailto:<a href="mailto:grasschoper@rediffmail.com">grasschoper@rediffmail.com</a>>>:<br>> > > > > > ><br>> > > > > > ><br>> > > > > > > there a programmers manual available in download
<br>> section on official<br>> > > > > sitye<br>> > > > > > > of GRASS. Give some time on reading it.<br>> > > > > > ><br>> > > > > > > enjoy grass
<br>> > > > > > > nitin<br>> > > > > > ><br>> > > > > > > On Tue, 28 Mar 2006 Ana Soares wrote :<br>> > > > > > ><br>
> > > > > > > >Thanks!<br>> > > > > > > ><br>> > > > > > > >That really helped :) But I have a lttle problem : I<br>> can't compile
<br>> > > > > it!<br>> > > > > > > >Any hints ?<br>> > > > > > > ><br>> > > > > > > >Thanks :-)<br>> > > > > > > >
<br>> > > > > > > >2006/3/27, Massimiliano Cannata<br>> <<a href="mailto:massimiliano.cannata@supsi.ch">massimiliano.cannata@supsi.ch</a><br>> <mailto:<a href="mailto:massimiliano.cannata@supsi.ch">
massimiliano.cannata@supsi.ch</a>>>:<br>> > > > > > > > ><br>> > > > > > > > > Ana Soares wrote:<br>> > > > > > > > ><br>
> > > > > > > > > > Hello :-)<br>> > > > > > > > > ><br>> > > > > > > > > > I'm getting really desperate with grass ...
<br>>
> > > > > > > > > I want to use
its libraries in my C program,<br>> but I can't seem to<br>> > > > > > > even<br>> > > > > > > > > > understand how to use G_gisinit :(<br>> > > > > > > > > >
<br>>
> > > > > > > > > Is there any
manual that you recommend to helo<br>> me out?<br>> > > > > > > > > ><br>>
> > > > > > > > > Help / Rescue
would be very much appreciated!!<br>> > > > > > > > > ><br>> > > > > > > > > > Thanks :-)<br>> > > > > > > > ><br>> > > > > > > > > give a look to
r.example and v.exaple files<br>> > > > > > > > > ( <a href="http://grass.itc.it/devel/index.php">http://grass.itc.it/devel/index.php</a>)<br>> > > > > > > > > hope it helps...
<br>> > > > > > > > > Max<br>> > > > > > > > ><br>> > > > > > > > > --<br>> > > > > > > > ><br>
> > > > > > > > > Eng. Massimiliano Cannata<br>>
> > > > > > > > Scuola Universitaria
Professionale della Svizzera<br>> Italiana<br>> > > > > > > > > Istituto Scienze della Terra<br>> > > > > > > > > Via Trevano, c.p. 72<br>> > > > > > > > > CH-6952 Canobbio-Lugano
<br>> > > > > > > > > Tel: +41 (0)58 666 62 18<br>> > > > > > > > > Fax +41 (0)58 666 62 09<br>> > > > > > > > ><br>> > > > > > > > >
<br>> > > > > > > > ><br>> > > > > > ><br>> > > > > > ><br>> > > > > > ><br>> > > > > > > <
<br>> > ><br>> > > > ><br>> <a href="http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490@Middle5?PARTNER=3">http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490@Middle5?PARTNER=3
</a><br>> > > > > ><br>> > > > ><br>> > > > ><br>> > > > ><br>> > > > ><br>> <<a href="http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490@Middle5?PARTNER=3">
http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490@Middle5?PARTNER=3</a><br>> <<a href="http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490@Middle5?PARTNER=3">
http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490@Middle5?PARTNER=3</a>><br>> ><br>> > ><br>> > ><br>> > ><br>> > >
<br>> > ><br>> ><br>> ><br>><br>> --<br>> -- marcos boullón magán<br>><br>><br><br></blockquote></div><br>