[LCP]static vs dynamic linking.

Rokicki, Andrew ARokicki at US.TIAuto.com
Wed May 7 00:38:01 UTC 2003


I need to look into this some more.
It seems that libraries I wrote and linking are giving me hard time.

On Tuesday, May 06, 2003 8:51 AM, Andrew Weaver
[SMTP:Andrew.Weaver at tecnomen.fi] wrote:
> What does the stack trace look like?
> 
> On Tuesday, May 06, 2003 3:16 PM, Rokicki, Andrew
> [SMTP:ARokicki at US.TIAuto.com] wrote:
> > Sorry I did mean -o no please don't guess.
> > The code compiles fine as static or dynamic linking I added -Wall there
is
> > no warnings.
> > But 
> > When I run it with dynamic linking it runs fine.
> > When I run it with static linking it gives me Segmentation fault.
> > It is a multithreaded program using pthreads. 
> > 
> > PS. I don't think it is the moon since the program is misbehaving today
> also
> > ;)
> > 
> > 
> > On Monday, May 05, 2003 7:20 PM, Greg Black [SMTP:gjb at gbch.net] wrote:
> > > On 2003-05-05, Rokicki, Andrew wrote:
> > > 
> > > > When I link my code dynamically it works.
> > > > something like this 
> > > > $(TARGET) : $(OBJS)
> > > >         $(CXX) -o $(TARGET) $(OBJS) $(LDFLAGS)
> > > > 
> > > > When i add -static it I get a Segmentation Fault.
> > > > 
> > > > $(TARGET) : $(OBJS)
> > > >         $(CXX) -static o $(TARGET) $(OBJS) $(LDFLAGS)
> > > > 
> > > > I am using RH 8.0 with gcc 3.2.
> > > > What am I missing ? 
> > > 
> > > The moon is in the wrong phase?  You left out the `-' in the
> > > `-o' after `-static'?  There's a bug in your code?  You're using
> > > C++ and expecting it to make sense?  How much would you like us
> > > to guess?
> > > 
> > > -- 
> > > Greg Black <gjb at gbch.net> <http://www.gbch.net/gjb.html>
> > > GPG signed mail preferred; further information in headers.
> > _______________________________________________
> > This is the Linux C Programming List
> > :  http://lists.linux.org.au/listinfo/linuxcprogramming List
> _______________________________________________
> This is the Linux C Programming List
> :  http://lists.linux.org.au/listinfo/linuxcprogramming List



More information about the linuxCprogramming mailing list