Re: [Boost-users] [program-options] static linked example segfaults for exception

ThanksVladimir and David,
I tried "-static" without "-static-libgcc" and "-Wl,-Bstatic" and it worked fine.
My test sample that uses program option and single threaded works fine with the above change.
But my other application that is multi threaded (using boost thread API) and uses program option still segfaults. When I try to add "libpthread" and "-lboost_thread-gcc41-mt" in linking I start getting segfaults.
LDFLAGS= -static -L/u/neetug/Projects/performance/perfstat_cluster/lib -lpthread -lboost_program_options-gcc41-mt -lboost_filesystem-gcc41-mt -lboost_system-gcc41-mt -lboost_thread-gcc41-mt -lrt
Appreciate you help
Regards,
NG
________________________________
From: David Kaplan
g++ testprogramoptions.o -static-libgcc -Wl,-Bstatic -L/u/neetug/Projects/performance/perfstat_cluster/lib -lboost_program_options-gcc41-mt -lpthread -o testprogramoptions
This is not the best way to link statically. Did you try just -static
option, without -static-libgcc and -Wl,-Bstatic?
Or you could try: -l:libboost_program_options-gcc41- mt

On 23 March 2010 08:25, Neetu Garg
Thanks Vladimir and David,
I tried "-static" without "-static-libgcc" and "-Wl,-Bstatic" and it worked fine.
My test sample that uses program option and single threaded works fine with the above change.
But my other application that is multi threaded (using boost thread API) and uses program option still segfaults. When I try to add "libpthread" and "-lboost_thread-gcc41-mt" in linking I start getting segfaults.
LDFLAGS= -static -L/u/neetug/Projects/performance/perfstat_cluster/lib -lpthread -lboost_program_options-gcc41-mt -lboost_filesystem-gcc41-mt -lboost_system-gcc41-mt -lboost_thread-gcc41-mt -lrt
Appreciate you help
Regards, NG
Did you try my suggestion? What did you get?
participants (2)
-
David Kaplan
-
Neetu Garg