Home Help Center

Problem including files in ice files

teoMaloteoMalo Member Matteo MalosioOrganization: Institute of Industrial Technology and AutomationProject: Prototype for robotic upper limb rehabilitation
Dears,

I'm trying to launch the following command:
slice2py -IDIR/usr/share/slice/ --ice VirtualReality.ice

but I get an error.

I have to include the <Ice/Identity.ice> file. It is located in the /usr/share/slice directory. But slice2py finds the following error:
error: Can't open include file "Ice/Identity.ice"
    #include <Ice/Identity.ice>
I'm not able to pass it to slice2py. I can't understand why.
#ifndef VIRTUALREALITY_ICE
#define VIRTUALREALITY_ICE

#include <Ice/Identity.ice>

module VirtualReality
{

const int nJoint = 7;
const int nCartesianDof = 6;

sequence<double> DoubleSeq;
const int DoubleSeqSize = 7;


interface CallbackReceiver
{
    void setEnvironment(string str);
    void setPosQuat(DoubleSeq seq);
};

interface GUIserver
{
    void addClient(Ice::Identity ident);
    void setProxy(CallbackReceiver* proxy);
    DoubleSeq getPosQuat();
    void startPosQuatStream();
    void stopPosQuatStream();
    void shutdown();
};

};


If I substitute
#include <Ice/Identity.ice>
with
#include </usr/share/slice/Ice/Identity.ice>
and call
slice2py --ice VirtualReality.ice
it works.


I can't understand why! Where am I wrong?

Thanks!

Comments

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Matteo

    slice2py -IDIR/usr/share/slice/ --ice VirtualReality.ice
    

    This command is incorrect, DIR is expected to be the directory path, so the correct command will be
    slice2py -I/usr/share/slice/ --ice VirtualReality.ice
    


    Cheers,
    José
  • teoMaloteoMalo Member Matteo MalosioOrganization: Institute of Industrial Technology and AutomationProject: Prototype for robotic upper limb rehabilitation
    Ops,
    thanks!
  • teoMaloteoMalo Member Matteo MalosioOrganization: Institute of Industrial Technology and AutomationProject: Prototype for robotic upper limb rehabilitation
    By the way,

    if I try to use this.ice file with
    Ice.loadSlice('VirtualReality.ice')
    
    I obtain
    File "Pa10RobotIce.py", line 5, in <module>
        Ice.loadSlice('VirtualReality.ice')
    RuntimeError: Slice preprocessing failed for `VirtualReality.ice'
    

    while "compiling" it with slice2py it works correctly.
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Matteo,

    You should also pass -I options to loadSlice
    Ice.loadSlice('-I/usr/share/slice VirtualReality.ice')
    

    Cheers,
    José
Sign In or Register to comment.