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

Interface inheritance problems

I've some problems compiling ice files.
I've two simple slice:
module test
interface Base
void Hello(string s);



#include <>

module test
interface MyBase extends Base
void Welcome(string s);

I compile first using the followig command:

slice2cppe --impl -I.

and then the with same command.

I build the generated files and I got the following compiler error in the MyBaseI.h file:

#ifndef __MyBaseI_h__
#define __MyBaseI_h__

#include <MyBase.h>

namespace test

class MyBaseI : virtual public MyBase,
virtual public ::test::BaseI

virtual void Welcome(const ::std::string&,
const Ice::Current&);



Error 1 error C2039: 'BaseI' : is not a member of 'test' MyBaseI.h 11


Error 2 error C2504: 'BaseI' : base class undefined MyBaseI.h 11

If I put the interface definition in one slice file I haven't the above compiler error.

I got the same errors compiling the generated files both on VS 2005 and Eclipse 3.2

Can someone help me.



  • dwayne
    dwayne St. John's, Newfoundland
    You can fix your compilation problem by manually adding an include of BaseI.h to MyBaseI.h. We will look into the possibility of changing the slice compiler so in the future this will not be necessary.
  • It works but..

    It works using Eclipse on Ubuntu, but I have same link error using VS 2005:

    Error 1 error LNK2019: unresolved external symbol "public: enum IceInternal::DispatchStatus __cdecl Ice::Object::___ice_ping(class IceInternal::Incoming &,struct Ice::Current const &)" (?___ice_ping@Object@Ice@@QAA?AW4DispatchStatus@IceInternal@@AAVIncoming@4@ABUCurrent@2@@Z) referenced in function "public: virtual enum IceInternal::DispatchStatus __cdecl HiveNet::Central::__dispatch(class IceInternal::Incoming &,struct Ice::Current const &)" (?__dispatch@Central@HiveNet@@UAA?AW4DispatchStatus@IceInternal@@Z) Central.obj

    I Build a new Project->Visual C++->Smart Device->MFC Smart Device Application->Dialog Based

    In Project->Properties->C/C++->PrecompiledHeaders->Use Precompiled Header I set "Not Using Precompiled Headers"

    In Project->Properties->Linker->Input->AdditionalDependencies I add "iceec_staticd.lib"

    What am I doing wrong?
  • dwayne
    dwayne St. John's, Newfoundland
    If you are linking with the pure client library (iceec) you must make sure that ICEE_PURE_CLIENT is defined when you compile your C++ source files. You need to either add this define to your client project or just link with the full (icee) library.
  • All OK

    It works.

    Thank you very much Dwayne.