[omniORB] ORB_init after fork() no worky?
Dan Kegel
dank@kegel.com
Wed, 20 Feb 2002 11:34:42 -0800
Christof Meerwald wrote:
>
> On Wed, 20 Feb 2002 02:59:29 -0800, Dan Kegel wrote:
> > Problem:
> > ORB_init() hangs if you fork first.
>
> This one might be related to a similar problem which came up on this mailing
> list nearly 2 years ago, see
> http://www.uk.research.att.com/omniORB/archives/2000-03/0232.html
>
> [...]
> > 2. compile (your commandline will differ):
> >
> > $ g++ -g -D__x86__ -I/opt/omniorb3/native/include
> > -L/opt/omniorb3/native/lib/i586_linux_2.0_glibc2.1 -lomniORB3 -ltcpwrapGK
> > test.cc
>
> You have to explicitely link with libpthread on Linux, it's best to use
> "-pthread" on the gcc command line (which AFAIK will also define
> _REENTRANT).
That was it! After adding -pthread, I also had to add -lomnithread
(go figure). Problem solved. And I suspect this will help prevent
other very odd problems in the future.
Thanks,
Dan