[LCP]static vs dynamic linking.

Rokicki, Andrew ARokicki at US.TIAuto.com
Tue May 6 20:17:01 UTC 2003


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.



More information about the linuxCprogramming mailing list