This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem creating a static library


Hi!

  I have tested to do the thing you recommended me to
 do the ld -r *.o -o new.o

  Then I have done the library libgol.a using the new.o.

  And what happens is that I get still 4 undefined symbols:

 ___Q23golt13ObjAppendList1ZPQ23gol14CalcBinderDatalPCPB1
___Q23golt13ObjAppendList1ZblPCb
___ls__Q23golt13ObjAppendList1ZPQ23gol14CalcBinderDataRCPB1
___ls__Q23golt13ObjAppendList1ZbRCb

  When I apply the c++filt to them, it gets me the next output.

  0005169c s gol::ObjAppendList<gol::CalcBinderData *>::ObjAppendList(long,
gol *const *)
  0005177c s gol::ObjAppendList<bool>::ObjAppendList(long, bool const *)
  00051484 s gol::ObjAppendList<gol::CalcBinderData *>::operator<<(gol
*const &)
  000515b4 s gol::ObjAppendList<bool>::operator<<(bool const &)

  But the others undefined symbols have disappeared.
  But I can't still do the executable.

  The .s files I do not think it will be a good approach, because I need to
deliver this makefile to build the libgol.a, so others could use it.

  As far as I know the problem with this is that it has the flag 's' if it
were 'S' it would work. So is there any way to get the 'S' flag, with a
makefile.


----- Original Message ----- 
From: "Mike Stump" <mrs@apple.com>
To: "Danilo José" <danilo.guerrero@deimos-space.com>
Cc: <gcc@gcc.gnu.org>
Sent: Friday, October 01, 2004 12:00 AM
Subject: Re: problem creating a static library


> On Sep 30, 2004, at 1:39 PM, Danilo José wrote:
> >   I suppose that .s file is the .a file
>
> .s is the assembly version of the file.  See man gcc under -save-temps.
>
> >   The thing is that I need to use the .a file, because it is a
> > requirement
> > of the migration to Mac Os X.
>
> Ok, another solution would be ld -r *.o -o new.o and put new.o in the
> .a file.  This might be the easiest to get working for you, now that I
> think of it.
>
> >    2)  I think the problems come because StdError.o does has undefined
> > that
> > method. Because if I include in the code of the StdError.c the template
> > instantiation that is not found, it does not have any problem to
> > compile.
> > But I can not do this because I can not duplicate the code, because
> > that
> > file is already compiled in another object.
>
> I don't know what you mean by cannot duplicate code.  template
> instantiation doesn't duplicate code[1].
>
> >     What is the other way that you told me of doing a workaround, I
> > did not
> > understand it very well.
>
> Remove the string notoc (or no_toc) and the extra , from the .s files
> before assembling.
>
>
> 1 - size a.out numbers remain the same, the summation of all the .o
> files appears larger than the a.out numbers.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]