[GRASS5] New MacOS X compilation errors

On Thu, Nov 30, 2000 at 02:18:04AM -0800, Markus Neteler wrote:

Hi Jeshua,

please
cvs update src/display/devices/XDRIVER
cd src/display/devices/XDRIVER
gmake5

and send the errors. Please add, if the references to
> > __XErrorFunction
> > __XIOErrorFunction
> > __Xdebug

I just updated the entire tree and In order to compile connect.c, I had to move connect.c.orig to connect.c. The errors I got were a bunch of messages like "connect.c:73: illegal expression, found `<<'" (I have a hunch that it is checked out our something...).

I got some errors about malloc and realloc, so I deleted line 1369 in SWITCHER.c to get it working.

Here is the errors for XDRIVER/XDRIVER24:

#################################################################
/usr/src/grass/src/display/devices/XDRIVER/XDRIVER24
  make -f OBJ.powerpc-apple-darwin1.2/make.rules

cc -o /usr/local/grass5/driver/XDRIVER OBJ.powerpc-apple-darwin1.2/SWITCHER.o OBJ.powerpc-apple-darwin1.2/Box_abs.o OBJ.powerpc-apple-darwin1.2/Can_do.o OBJ.powerpc-apple-darwin1.2/Color.o OBJ.powerpc-apple-darwin1.2/Cont_abs.o OBJ.powerpc-apple-darwin1.2/Clr_table.o OBJ.powerpc-apple-darwin1.2/Draw_line.o OBJ.powerpc-apple-darwin1.2/Get_w_box.o OBJ.powerpc-apple-darwin1.2/Get_w_line.o OBJ.powerpc-apple-darwin1.2/Get_w_pnt.o OBJ.powerpc-apple-darwin1.2/Graph_Clse.o OBJ.powerpc-apple-darwin1.2/Graph_Set.o OBJ.powerpc-apple-darwin1.2/Panel.o OBJ.powerpc-apple-darwin1.2/Plylne_abs.o OBJ.powerpc-apple-darwin1.2/Polygn_abs.o OBJ.powerpc-apple-darwin1.2/Returns.o OBJ.powerpc-apple-darwin1.2/Serve_Xevent.o OBJ.powerpc-apple-darwin1.2/alloc.o OBJ.powerpc-apple-darwin1.2/command_pend.o OBJ.powerpc-apple-darwin1.2/Raster.o ./lib/LIB.powerpc-apple-darwin1.2/driverlib.a /usr/src/grass/src/libes/LIB.powerpc-apple-darwin1.2/libD.a /usr/src/grass/src/libes/LIB.powerpc-apple-darwin1.2/libgis.a -L/usr/X11R6/lib -lSM -lICE -lX11
/usr/bin/ld: Undefined symbols:
__XErrorFunction
__XIOErrorFunction
__Xdebug
make[1]: *** [/usr/local/grass5/driver/XDRIVER] Error 1
make: *** [all] Error 2
#################################################################

On Thu, Nov 30, 2000 at 02:18:04AM -0800, Markus Neteler also wrote:

are missing the results of

grep XErrorFunction /usr/include/X11
grep XIOErrorFunction /usr/include/X11
grep Xdebug /usr/include/X11

and send this as well. Then we might to find the problem.
It's strange that you could compile the beta8 driver. Nothing has
been changed in this issue...

Markus

Markus- Here you are (Note that the X11 include directory is located at "/usr/X11R6/lib/" not "/usr/include/X11" so I made symbolic link to see if it would help, it didn't):

[localhost:display/devices/XDRIVER] root# grep XErrorFunction /usr/X11R6/lib/*

Binary file /usr/include/X11/libX11.a matches

[localhost:display/devices/XDRIVER] root# grep XIOErrorFunction /usr/X11R6/lib/*

Binary file /usr/include/X11/libX11.a matches

[localhost:display/devices/XDRIVER] root# grep Xdebug /usr/X11R6/lib/*

Binary file /usr/include/X11/libX11.a matches

Anything else to try?

On Thu, Nov 30, 2000 at 02:18:04AM -0800, Jeshua Lacock wrote:
> Markus said:
> > On Tue, Nov 28, 2000 at 10:40:29AM -0800, Jeshua Lacock wrote:
> > >Hi Jeshua,
> > >
> > >another one for you :slight_smile: Hope you don't mind.
> > >Is the Xdriver compiling? And: is it in published beta8?
> > >Otherwise it would be fully useless!
> > >
> >
> >
> > Hello Markus!
> >
> > Yes, the xdriver was compiled and published with beta 8, however I
> > cannot get it to compile at this time....
>
> Mhh, that's strange. Please send me some error messages. We should
> get it compile asap. (I want to get out beta9!).
>
> Here's the XDRIVER thread:
>
> Begin forwarded message:
>
> > From: Jeshua Lacock <jeshua@SierraMaps.com>
> > Date: Tue Nov 21, 2000 11:37:28 PM US/Pacific
> > To: grass5@geog.uni-hannover.de
> > Subject: Re: [GRASS5] New MacOS X compilation errors
> > X-Mailer: Apple Mail (2.337)
> >
> >
> > Howdy folks,
> >
> > On Tue, Nov 21, 2000 at 07:59:32PM +0000, Markus Neteler wrote:
> Hi Jeshua and all,
>
>
> > I have updated all malloc -> G_malloc in
> src/display/devices/XDRIVER
>
> cvs up
> > src/display/devices/XDRIVER
> gmake5 src/display/devices/XDRIVER
>
> Please
> > tell me if it is o.k. now.
> >
> > OK, I updated the source and ran gmake5.
> >
> > And I got a bunch or errors like: SWITCHER.c:1396: illegal expression, found `>>'
> >
> > So, I edited the SWITCHER.c file and deleted the lines that were <<<<<<<<, =========.
> > >>>>>>> and deleted the old malloc statements to get to the next step.
> >
> > Then, I ran gmake5 again to get these errors:
> >
> > SWITCHER.c: In function `xalloc':
> > SWITCHER.c:1369: conflicting types for `malloc'
> > /System/Library/Frameworks/System.framework/Headers/bsd/stdlib.h:121:
> > previous declaration of `malloc'
> > SWITCHER.c:1369: warning: extern declaration of `malloc' doesn't match global one
> > SWITCHER.c:1369:

/System/Library/Frameworks/System.framework/Headers/bsd/stdlib.h:125:

> > previous declaration of `realloc'
> > SWITCHER.c:1369: warning: extern declaration of `realloc' doesn't match global one
> > make[1]: *** [OBJ.powerpc-apple-darwin1.2/SWITCHER.o] Error 1
> > make: *** [all] Error 2
> >
> >
> > So then I edited SWITHCER.c again and deleted line 1369 (where mallox and realloc were
> > re-defined).
> >
> > Then, I ran gmake5 again to get these errors:
> >
> >
> > Raster.c: In function `Raster_int':
> > Raster.c:83: warning: assignment from incompatible pointer type
> > Raster.c:85: warning: assignment from incompatible pointer type
> > cc -o /usr/local/grass-5.0b/driver/XDRIVER
> > OBJ.powerpc-apple-darwin1.2/SWITCHER.o
> > OBJ.powerpc-apple-darwin1.2/Box_abs.o OBJ.powerpc-apple-darwin1.2/Can_do.o
> > OBJ.powerpc-apple-darwin1.2/Color.o OBJ.powerpc-apple-darwin1.2/Cont_abs.o
> > OBJ.powerpc-apple-darwin1.2/Clr_table.o
> > OBJ.powerpc-apple-darwin1.2/Draw_line.o
> > OBJ.powerpc-apple-darwin1.2/Get_w_box.o
> > OBJ.powerpc-apple-darwin1.2/Get_w_line.o
> > OBJ.powerpc-apple-darwin1.2/Get_w_pnt.o
> > OBJ.powerpc-apple-darwin1.2/Graph_Clse.o
> > OBJ.powerpc-apple-darwin1.2/Graph_Set.o OBJ.powerpc-apple-darwin1.2/Panel.o
> > OBJ.powerpc-apple-darwin1.2/Plylne_abs.o
> > OBJ.powerpc-apple-darwin1.2/Polygn_abs.o
> > OBJ.powerpc-apple-darwin1.2/Returns.o
> > OBJ.powerpc-apple-darwin1.2/Serve_Xevent.o
> > OBJ.powerpc-apple-darwin1.2/alloc.o
> > OBJ.powerpc-apple-darwin1.2/command_pend.o
> > OBJ.powerpc-apple-darwin1.2/Raster.o
> > ./lib/LIB.powerpc-apple-darwin1.2/driverlib.a
> > /usr/src/grass/grass/src/libes/LIB.powerpc-apple-darwin1.2/libD.a
> > /usr/src/grass/grass/src/libes/LIB.powerpc-apple-darwin1.2/libgis.a
> > -L/usr/X11R6/lib -lSM -lICE -lX11
> > /usr/bin/ld: Undefined symbols:
> > __XErrorFunction
> > __XIOErrorFunction
> > __Xdebug
> > make[1]: *** [/usr/local/grass-5.0b/drive

Error 2

> >
> >
> > At which point I get stumped! (Heeeeelp!)
> >
> >
> > Jeshua Lacock
>
>
> Jeshua Lacock
--
Dipl.-Geogr. Markus Neteler * University of Hannover
Institute of Physical Geography and Landscape Ecology
Schneiderberg 50 * D-30167 Hannover * Germany
Tel: ++49-(0)511-762-4494 Fax: -3984

Jeshua Lacock
Cartographer/Owner
http://SierraMaps.com
http://3dTopoMaps.com
Telephone: (760) 935-4481
----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Jeshua,

I have already send an instruction on how to deal with the errors below.
Please remove the files you edited by hand _before_ updating your local
CVS copy. Otherwise you'll get the conflicts, that have to be resolved
manually, what is not what you want to do.

To repeat: remove the file connect.c, do a cvs update -dP and recompile
then with gmake5 or with make install from the top directory (like in
the instruction from Markus).

Please send the header file (src/CMD/head/head.powerpc-apple-darwin1.2)
to the list, so that we can check if the X11 libraries are included.

It is always complicated to do this sort of remote-diagnosis, i am not
familiar with BSD and Darwin/Mac OS X and i don't know which level of
expertise to expect from you. So please ask if you do not understand
something.

cu,

Andreas

Jeshua Lacock wrote:

On Thu, Nov 30, 2000 at 02:18:04AM -0800, Markus Neteler wrote:
> Hi Jeshua,
>
> please
> cvs update src/display/devices/XDRIVER
> cd src/display/devices/XDRIVER
> gmake5
>
> and send the errors. Please add, if the references to
> > > __XErrorFunction
> > > __XIOErrorFunction
> > > __Xdebug
>

I just updated the entire tree and In order to compile connect.c, I had to move connect.c.orig to connect.c. The errors I got were a bunch of messages like "connect.c:73: illegal expression, found `<<'" (I have a hunch that it is checked out our something...).

I got some errors about malloc and realloc, so I deleted line 1369 in SWITCHER.c to get it working.

Here is the errors for XDRIVER/XDRIVER24:

#################################################################
/usr/src/grass/src/display/devices/XDRIVER/XDRIVER24
  make -f OBJ.powerpc-apple-darwin1.2/make.rules

/usr/bin/ld: Undefined symbols:
__XErrorFunction
__XIOErrorFunction
__Xdebug
make[1]: *** [/usr/local/grass5/driver/XDRIVER] Error 1
make: *** [all] Error 2
#################################################################

--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
Andreas.Lange@Rhein-Main.de - A.C.Lange@GMX.net

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Sat, Dec 02, 2000 at 12:39:13AM -0800, Jeshua Lacock wrote:

I just updated the entire tree and In order to compile connect.c, I
had to move connect.c.orig to connect.c. The errors I got were a bunch
of messages like "connect.c:73: illegal expression, found `<<'" (I
have a hunch that it is checked out our something...).

I got some errors about malloc and realloc, so I deleted line 1369 in
SWITCHER.c to get it working.

If there are << "sometext" or >> "sometext", that means there was a
problem with the cvs merge. This can usually be fixed by simply
deleting the file then run "cvs -z3 update -d [somefile]" which will
fetch a fresh copy. In general, if you go around editing files and then
do a cvs update it's likely to cause these problems if someone else has
edited those files since you last did an update. The line number
offsets 'diff' uses will no longer be valid for the merge operation.

Deleting lines that have malloc/realloc is never a good thing either, as
you've just removed a probably critical memory allocation function call.
The program may compile, but is likely to get a SIGSEGV somewhere during
it's execution when it tries to access a NULL pointer or memory that
isn't allocated. malloc/realloc should be defined in the header
<stdlib.h> and always be part of libc. It's possible the offending file
did not '#include <stdlib.h>' which may not be a problem on some
systems, but is on others. The solution would be to make sure that
header include statement is at the top of the file. But, actually I
guess it was decided to always use the G_malloc, G_calloc and G_realloc
wrappers that are defined in "gisdefs.h" which is included by "gis.h".
So perhaps these function calls need to be changed???

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'