[GRASS5] Pre4 on Mac OS X

Jeshua Lacock jeshua at SierraMaps.com
Tue May 28 06:05:44 EDT 2002


On Monday, May 27, 2002, at 08:10 PM, Glynn Clements wrote:

>
> Jeshua Lacock wrote:
>
>> To successfully build "src/libes/proj", I had to edit geod.c: It was
>> pciky about the order of including "ctype.h".
>
> What exactly was the problem? Error messages?
>
> If a header fails to compile after ctype.h has been included, we may
> need to change the header.

Here it is:

gcc -I/usr/src/grass5.0.0pre4/src/include -O2 -no-cpp-precomp 
-D__unix__   -I.   -c geod.c -o OBJ.powerpc-apple-darwin5.4/geod.o
In file included from geod.c:9:
/usr/include/ctype.h:128: parse error before `.'
/usr/include/ctype.h: In function `__istype':
/usr/include/ctype.h:130: `c' undeclared (first use in this function)
/usr/include/ctype.h:130: (Each undeclared identifier is reported only 
once
/usr/include/ctype.h:130: for each function it appears in.)
/usr/include/ctype.h: At top level:
/usr/include/ctype.h:135: parse error before `.'
/usr/include/ctype.h: In function `__isctype':
/usr/include/ctype.h:137: `c' undeclared (first use in this function)
geod.c: In function `main':
geod.c:133: warning: return type of `main' is not `int'
make: *** [OBJ.powerpc-apple-darwin5.4/geod.o] Error 1

I have actually ran into this quite a few times building various 
pacakges, and it is just a matter of the order of the includes, or not 
the right ones included.

>> I have run into some linking trouble with geo.point:
>>
>> gcc -L/usr/src/grass5.0.0pre4/src/libes/LIB.powerpc-apple-
>> darwin5.4   -o
>> /usr/src/grass5.0.0pre4/dist.powerpc-apple-darwin5.4/etc/geo.point
>> OBJ.powerpc-apple-darwin5.4/bin_point.o  LIB.powerpc-apple-
>> darwin5.4/libgeo.a -lgis -llock  -I/usr   -lz
>> /usr/bin/ld: Undefined symbols:
>> _ax
>> _ay
>> _bx
>> _by
>> _use
>
> These are defined in src/libes/vect32/georef/vars.c, which should be
> part of libgeo. Were there any errors in building libgeo?

Negative, there was no error building libgeo.

Linking in "vars.o" fixed the problem. I realize it is abit of a hack 
but it seems to work:

gcc -L/usr/src/grass5.0.0pre4/src/libes/LIB.powerpc-apple-darwin5.4 -o 
/usr/src/grass5.0.0pre4/dist.powerpc-apple-darwin5.4/etc/geo.point 
OBJ.powerpc-apple-darwin5.4/bin_point.o OBJ.powerpc-apple-
darwin5.4/vars.o LIB.powerpc-apple-darwin5.4/libgeo.a -lgis -llock 
-I/usr -lz

>> I thoght it was a link order error, so I tried:
>>
>> cc -L/usr/src/grass5.0.0pre4/src/libes/LIB.powerpc-apple-darwin5.4   -o
>> /usr/src/grass5.0.0pre4/dist.powerpc-apple-darwin5.4/etc/geo.point
>> LIB.powerpc-apple-darwin5.4/libgeo.a OBJ.powerpc-apple-
>> darwin5.4/bin_point.o -lgis -llock  -I/usr   -lz
>> /usr/bin/ld: Undefined symbols:
>> _geo_read_control
>
> This is defined in src/libes/vect32/georef/geo_file.c, also part of
> libgeo. However, I would expect this to generate an error; libraries
> must come *after* any files which make use of them.

Thanks for the info and all of your help.

I now have successfully built 100% of the modules Pre4, and I am 
currently uploading the binaries. Markus: I will email you when it is 
done uploading.

I just read the fix about the "make install" bug, and it installed just 
fine, and everything seems to work so far.

However, it did complain that I did not set the GISDBASE environment, 
which I have not needed to set it before. Once I set it everything seems 
ok.

Also, when I quit Grass, I select the "close all X windows" option, and 
all the windows and menus close, except for the actual monitors.

Note that I also had to change "<malloc.h>" to  "<sys/malloc.h>" for 
main.c in r.sun and for main.c, dataoct.c, oct.c, user2.c, user4.c in 
s.vol.rst.

I had to add "-liconv" in src/display/d.text.freetype.

And I had to:

*** orig/dbmscap.c      Tue Apr  9 02:09:48 2002
--- new/dbmscap.c       Tue May 28 00:43:26 2002
***************
*** 1,3 ****
--- 1,4 ----
+ #include <sys/types.h>
   #include <dirent.h>
   #include <string.h>
   #include <stdlib.h>

Or else I got:

In file included from /usr/include/dirent.h:64,
                  from dbmscap.c:1:
/usr/include/sys/dirent.h:73: parse error before `u_int32_t'
/usr/include/sys/dirent.h:73: warning: no semicolon at end of struct or 
union
/usr/include/sys/dirent.h:74: warning: data definition has no type or 
storage class
/usr/include/sys/dirent.h:75: parse error before `d_type'
/usr/include/sys/dirent.h:75: warning: data definition has no type or 
storage class
/usr/include/sys/dirent.h:76: parse error before `d_namlen'
/usr/include/sys/dirent.h:76: warning: data definition has no type or 
storage class
/usr/include/sys/dirent.h:83: parse error before `}'
dbmscap.c: In function `db_read_dbmscap':
dbmscap.c:141: invalid use of undefined type `struct dirent'
dbmscap.c:141: dereferencing pointer to incomplete type
dbmscap.c:142: invalid use of undefined type `struct dirent'
dbmscap.c:142: dereferencing pointer to incomplete type
dbmscap.c:144: invalid use of undefined type `struct dirent'
dbmscap.c:144: dereferencing pointer to incomplete type
dbmscap.c:145: invalid use of undefined type `struct dirent'
dbmscap.c:145: dereferencing pointer to incomplete type
make: *** [OBJ.powerpc-apple-darwin5.4/dbmscap.o] Error 1


Cheers,

Jeshua Lacock __________________________
Programmer/Owner            Phone:   760.935.4736
http://OpenOSX.com           Fax:        760.935.4845
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_




More information about the grass-dev mailing list