[omniORB] Problem: no matching function for call to CosNaming::BindingList_var::length()

Dan Kegel dank@kegel.com
Thu, 14 Feb 2002 12:24:07 -0800


I'm having problems with OmniOrb 3 and iterating through
a naming context.

My system: red hat 7.2, x86, gcc 2.96-98; 
Omniorb 3.0.4.

The error:
c++ -c -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
-Wwrite-strings -O2   -DPACKAGE=\"dkftpbench\" -DVERSION=\"0.40\" -DHAVE_LIBNSL=1 -DHAVE_INET_ATON=1 -DHAVE_DEVPOLL=0 -DHAVE_DEVEPOLL=0 -D_GNU_SOURCE=1
-DHAVE_F_SETSIG=1 -DHAVE_PTHREAD_H=1 -DHAVE_NAMESPACES= -D__x86__=1 -DIDL_CLN_H_SUFFIX=.hh -DIDL_CLN_CPP_SUFFIX=SK.cc -DIDL_SRV_H_SUFFIX=.hh
-DIDL_SRV_H_SUFFIX=.hh -DCORBA_H=\<omniORB3/CORBA.h\> -DCOSNAMING_H=\<omniORB3/Naming.hh\> -DCORBA_MODULE_NAMESPACE_MAPPING=1 -DOMNIORB=1 -DCORBA_HAVE_POA=1
-DCORBA_ORB_INIT_HAVE_3_ARGS=1 -DCORBA_ORB_INIT_THIRD_ARG=\"omniORB3\" -DCORBA_ORB_HAVE_DESTROY=1  -I. -I.   -D__x86__  -I/opt/omniorb3/native//include  -o
corbaftpbench.o corbaftpbench.cc
cc1plus: warning: Ignoring command line option '-Wstrict-prototypes'
cc1plus: warning: Ignoring command line option '-Wmissing-declarations'
corbaftpbench.cc: In function `int main (int, char **)':
corbaftpbench.cc:125: no matching function for call to
`CosNaming::BindingList_var::length ()'
corbaftpbench.cc:129: no matching function for call to
`CosNaming::BindingList_var::length ()'
make: *** [corbaftpbench] Error 1

The code:
        CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
        CORBA::Object_var nsov=orb->resolve_initial_references("NameService");
        CosNaming::NamingContext_var nsv = CosNaming::NamingContext::_narrow(nsov);
        assert(!CORBA::is_nil(nsv));
        CosNaming::BindingIterator_var it;
        CosNaming::BindingList_var bl;
        const CORBA::ULong CHUNK = 1000;
        nsv->list(CHUNK, bl, it);
        CorbaPlatoon_var *platoons = new CorbaPlatoon_var[bl.length()];
                                                          ^^^^^^^^^^^

This code is taken fairly closely from "Advanced Corba Programming with C++".

What gives?  Hopefully I just made some newbie mistake.

Should I rebuild Omniorb and my app with gcc3?

Thanks,
Dan