More libfile problems

Theo Markettos theo at
Mon Feb 25 13:10:09 PST 2002

I'm building a C++ library which makes use of templates.  All the object
files are compiled, and I want to build a library from them.  The problem
is that when I call libfile, I get an unspecified error:

*gccbin:libfile -c libga.o garandom.o gaerror.o GAParameter.o
GAStatistics.o GABaseGA.o GASStateGA.o GASimpleGA.o GAIncGA.o GADemeGA.o
GADCrowdingGA.o GASelector.o GAScaling.o GAPopulation.o GAGenome.o
GABinStr.o gabincvt.o GAAllele.o GA1DBinStrGenome.o GA2DBinStrGenome.o
GA3DBinStrGenome.o GABin2DecGenome.o GA1DArrayGenome.o GA2DArrayGenome.o
GA3DArrayGenome.o GATreeBASE.o GATree.o GATreeGenome.o GAListBASE.o
GAList.o GAListGenome.o

Termination signal received: RISC OS error

Using Acorn's libfile (using an old version or the latest 32 bit release)
works fine.  If I call it libga (without an extension), it claims to
complete successfully, but only gives a 112 byte output file with ALF
header and nothing else.  Attempting to supply filenames in
format doesn't help.  When I take the correct-looking output from
Acorn's libfile and pass it to g++:

g++ ex1.o -o ex1 -L. -lm ../ga/libga.o -liostream
Error: Library '^.ga.o.libga' does not appear to be an object code library
Drlink: Link failed with 1 error

ld fatal error: program gccpkg:bin/drlink returned exit status 3072:
g++: Fatal compiler error: program ld

The only way I can persuade it to link is to supply all the object files
separately, which is clearly painful.

How do I convince g++ that my library is actually an ALF file that it can

I can provide the relevant directory if this is of use to anyone to
investigate, but it'll take a while to upload over my poor modem as it's


More information about the gcc mailing list