Hi :-)<br>
<br>
<br>
It compiles. But this I don't understand : it runs in grass but not in 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><div><span class="gmail_quote">2006/3/28, marcos boullón magán <<a href="mailto:marcosboullon@gmail.com">marcosboullon@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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>><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>> ><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 <<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 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 <
<a href="mailto:grasschoper@rediffmail.com">grasschoper@rediffmail.com</a>>:<br>> > > > > ><br>> > > > > ><br>> > > > > > there a programmers manual available in download 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 can't compile<br>> > > > it!<br>> > > > > > >Any hints ?<br>> > > > > > >
<br>> > > > > > >Thanks :-)<br>> > > > > > ><br>> > > > > > >2006/3/27, Massimiliano Cannata <<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, 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 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 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>> > > > <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>> > > > <<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>-- marcos boullón magán<br></blockquote></div><br>