[GRASSLIST:357] Re: grass libraries
Ana Soares
tiobrothercamarada at gmail.com
Fri Mar 24 09:30:00 EST 2006
seabiscuit at ubuntu:/$ ls /usr/local/lib/
firmware/ python2.4/ site_ruby/
seabiscuit at ubuntu:/$ ls /usr/local/lib
firmware python2.4 site_ruby
$ ls /usr/lib/grass/
bin bwidget docs driver etc fonts include lib man scripts
But I think I fixed the problem now! :)
Here's the makefile :
prot1: utils.o db_mg.o session.o main.o
gcc -o prot1 -L/usr/lib/grass/lib utils.o db_mg.o session.o
main.o-lreadline -lcurses -lgrass_gis -lm
main.o:
gcc -c -I /usr/lib/grass/include -L/usr/lib/grass/lib main.c
session.o:
gcc -c session.c
db_mg.o:
gcc -c -I /usr/lib/grass/include db_mg.c
utils.o:
gcc -c utils.c
clean:
rm -f *.o *~ prot1
Thanks anyway for the help! :-D
2006/3/24, marcos boullón magán <marcosboullon at gmail.com>:
>
> > gcc -o prot1 utils.o db_mg.o session.o main.o -lreadline -lcurses
> > -lgrass_gis
> > /usr/bin/ld: cannot find -lgrass_gis
> > collect2: ld returned 1 exit status
> > make: *** [prot1] Error 1
>
> Yoy forgot again the -L/usr/local/grass6/lib switch in the linking
> command (you have all the GRASS libs there, haven't you?).
>
> Anyway, the easiest way to start programming against theses libraries
> is reusing the code in grass6/vector/v.sample directory, in GRASS
> sourcecode. Rename your code as "main.c" and run "make" to compile.
> Unfortunately the Makefile file assumes that you managed to compile
> and build GRASS, not a trivial task (nor too dificult).
>
> Good luck,
>
> M.
>
> --
> -- marcos boullón magán
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20060324/2aa614cc/attachment.html
More information about the grass-user
mailing list