A problem compiling the iodemos on Linux ELF

Adrian Perez Jorge alu1415@csi.ull.es
Fri, 1 Aug 1997 20:13:16 +0000 (GMT)



On Fri, 16 May 1997, Ricardo Diaz Santiago wrote:

> 
> 
> I have Linux ELF 2.0 (Slackware 3.0) with Xview 3.2 and Clean 1.112
> 
> When trying to compile the iodemos I got the following messages:
> 
> ----------------------------------------------------------------~
> clm -sl x -nw LifeGame -o LifeGame
> Warning [Life.icl,82,Neighbours`]: function may fail
> Warning [Life.icl,112,NewBornNeighbours`]: function may fail
> Warning [Life.icl,161,InsertCell]: function may fail
> Warning [Help.icl,43,MakeAboutDialog]: lft,bft not used
> Warning [Help.icl,43,MakeAboutDialog]: dft not used
> Warning [Help.icl,62,SelectLargeFont]: dummy not used
> Warning [Help.icl,73,SelectNormalFont]: dummy not used
> Warning [Help.icl,86,ReadInfo]: b not used
> Warning [Help.icl,104,ProcessInfoStrings]: nmw,lmw not used
> Warning [Help.icl,208,ShowHelp]: lft,bft not used
> Warning [Help.icl,208,ShowHelp]: dft not used
> Warning [Help.icl]: derived strictness properties approximated
> /usr/openwin/lib/libxview.so: undefined reference to `__eprintf'
> Compiling LifeGame
> Compiling Life
> Compiling Help
> Generating code for LifeGame
> Assembling LifeGame
> Generating code for Help
> Assembling Help
> Generating code for Life
> Assembling Life
> Linking LifeGame
> make: *** [LifeGame] Error 1
> ------------------------------------------------------------------
> 
> what can I do to compile the io demos?
> 
> Thanks in advance
> 
> Ricardo Diaz Santiago.
> rdiaz@alpha.cs.cinvestav.mx
> 
> 
> 
> 
> 
> 


This is the problem:

	Library libxview.so uses the function __eprintf which is 
implemented in the gcc run-time library "libgcc.a" (the port of the 
Xview toolkit was done with gcc). Last version of the linker "ld" (wich
Clean uses to link modules) does not include that library by default (at
least not the version I have -> cygnus-2.7.1). Older version of "ld" do, so
that's why nobody seems to have that problem ;-).

An ugly solution:

	Explicitly link the "libgcc.a" library. 

	In file ~/clean/iolib/xv.lo, where you see
----------------------------------------------------------------
-lolgx
-lXmu
-lX11

# The equal sign...
----------------------------------------------------------------

	you should write

----------------------------------------------------------------
-lolgx
-lXmu
-lX11
/usr/lib/gcc-lib/i486-linux/2.7.2.1/libgcc.a

# The equal sign...
----------------------------------------------------------------

	or whatever directory "libgcc.a" is stored in (usually
 /usr/local/lib/<machine>/<version> or /usr/lib/<machine>/<version>).

	After that, you can compile all examples. (Caution! Run a 
"make cleanup" in ~/iodemos/Life directory before recompile the example!).

	This is not a satisfactory solution because you have to change
the path of the gcc run-time library every time you install newer versions
of gcc or for a different machine, so it's not suitable to do that in a
Clean distribution.

	Has anybody a better solution?


Espero Ricardo, que te funcione...

Adios! (Bye!)