[GRASS5] snprintf and other compile errors on IRIX

Eric G. Miller egm2 at jps.net
Fri Apr 26 11:03:37 EDT 2002


On Fri, Apr 26, 2002 at 03:26:19PM +0100, Paul Kelly wrote:

> > > Compilation error in module: src/raster/r.in.gdal (ignored)
> > >
> > > cc -L/indigo-disk2/grass/grass/src/libes/LIB.mips-sgi-irix6.2
> > > -L/indigo-disk2/grass/doom.ee.qub.ac.uk/lib -o
> > > /indigo-disk2/grass/grass/dist.mips-sgi-irix6.2/etc/bin/cmd/r.in.gdal
> > > OBJ.mips-sgi-irix6.2/main.o OBJ.mips-sgi-irix6.2/gbgetsymbol.o
> > > OBJ.mips-sgi-irix6.2/gdalbridge.o OBJ.mips-sgi-irix6.2/make_loc.o \
> > >          -lgis -lI -lproj -lm  -lz
> > > ld: ERROR 33: Unresolved text symbol "GBGetSymbol" -- 1st referenced by
> > > OBJ.mips-sgi-irix6.2/gdalbridge.o.
> > > ld: INFO 152: Output file removed because of error.
> > 
> > This suggests that neither
> > 
> >         #if defined(__unix__)
> > nor
> >         #ifdef _WIN32
> > 
> > are true. Can you provide a suitable symbol which could be tested?
> 
> I made the following change to gbgetsymbol.c to get it to work
>
> 53c53
> < #if defined(__unix__)
> ---
> > #if defined(__unix)
>
> Extract from IRIX cc man page:

Problem is, these symbols are compiler specific. It is definitely
__unix__ for gcc, but all __<foo> symbols are reserved for the
implementation (i.e. platform specific).

> There was also a compile error in src/raster/r.le, which I forgot to
> mention in my earlier e-mail. It involved strings broken over multiple
> lines again, which I fixed by putting backslashes at the end of the
> broken lines. The two files affected were src/raster/r.le/r.le.patch/input.c
> and src/raster/r.le/r.le.pixel/input.c and the diff files for the changes
> are as follows

[snip]

Hmm. Those still seem wrong.  I'm guessing what is wanted is:

 foo = "Some line of text.\n"\
 "\tAnother line of text with a leading tab character.\n";

Quotes should not be broken across lines.  It is not the right way to
embed newlines (this isn't Perl or sh ...) since the compiler will
probably strip those newlines when parsing the code.

> So if all the snprintf() calls have been removed, v.in.mif
> is now the only module not compiling on IRIX 6.2 (out
> of those enabled in src/CMD/lists/GRASS of course). My 
> next big challenge is to get SG3d working with GRASS 5 (I
> currently only have the non-floating point version working
> with GRASS 4.3).

There're still some instances of snprintf()...

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



More information about the grass-dev mailing list