problem with dual included idl files



I've got two idl files that include the same two other idl files.  When
I try to use the first two in the same perl program I get the following
error when I run perl -c foo.pl

  Constant subroutine SERIALIZER_NO_WAIT redefined at
  /usr/lib/perl5/site_perl/5.6.1/i386-linux/CORBA/ORBit.pm line 65535.
  Constant subroutine SERIALIZER_WAIT_FOREVER redefined at
  /usr/lib/perl5/site_perl/5.6.1/i386-linux/CORBA/ORBit.pm line 65535.
  foo.pl syntax OK

If the first idl file includes the second, and then second idl file
includes the other two idl files, then I don't get the error.

This generates the error:

  Widget.idl:
  
    #include "foo.idl"
    #include "bar.idl"
    ...
  
  Dohicky.idl:
  
    #include "foo.idl"
    #include "bar.idl"
    ...
  
  foo.pl:
  
  #!/usr/bin/perl -w
  
  BEGIN {
      my $ns_ior = `GET http://foo/foo.ior`;
      chomp $ns_ior;
      unshift @ARGV, "-ORBNamingIOR=$ns_ior";
  }
  
  use Error qw(:try);
  use strict;
  
  use CORBA::ORBit idl_path => '/foo/ace/TAO/orbsvcs/orbsvcs:/foo/idl:/bar/idl',
                   idl      => [ qw(CosNaming.idl Widget.idl Dohicky.idl) ];
  
  my $orb = CORBA::ORB_init(@ARGV);
  my $ns = $orb->resolve_initial_references('NameService');
  
  my $name = [{'id' => 'foo',    'kind' => ''},
              {'id' => 'bar', 'kind' => ''},
              {'id' => 'bletch', 'kind' => ''}];
  
  my $gizmo = $ns->resolve($name);
  
  try {
      $gizmo->widget::thingy::gizmo();
  } otherwise {
      die "couldn't use the gizmo: $? $! \n";
  };

While this does not:

  Widget.idl:
  
    #include "foo.idl"
    #include "bar.idl"
    ...
  
  Dohicky.idl:
  
    #include "Widget.idl"
    ...
  
  foo.pl:
  
  #!/usr/bin/perl -w
  
  BEGIN {
      my $ns_ior = `GET http://foo/foo.ior`;
      chomp $ns_ior;
      unshift @ARGV, "-ORBNamingIOR=$ns_ior";
  }
  
  use Error qw(:try);
  use strict;
  
  use CORBA::ORBit idl_path => '/foo/ace/TAO/orbsvcs/orbsvcs:/foo/idl:/bar/idl',
                   idl      => [ qw(CosNaming.idl Dohicky.idl) ];
  
  my $orb = CORBA::ORB_init(@ARGV);
  my $ns = $orb->resolve_initial_references('NameService');
  
  my $name = [{'id' => 'foo',    'kind' => ''},
              {'id' => 'bar', 'kind' => ''},
              {'id' => 'bletch', 'kind' => ''}];
  
  my $gizmo = $ns->resolve($name);
  
  try {
      $gizmo->widget::thingy::gizmo();
  } otherwise {
      die "couldn't use the gizmo: $? $! \n";
  };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]