Archived

This forum has been archived. Please start a new discussion on GitHub.

Problem including files in ice files

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

  • xdm
    xdm La Coruña, Spain
    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é
  • Ops,
    thanks!
  • 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.
  • xdm
    xdm La Coruña, Spain
    Hi Matteo,

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

    Cheers,
    José