Archived

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

Hello Word demo problem on Ubuntu 12.04 and Eclipse C++

Hi,

I follow the instruction in the Ice 3.4 manual for the Hello World demo example.

I create a slice file and convert it with the slice2cpp utility.

I create a project in Eclipse and import both Printer.h and Printer.cpp files to the project and add the example code to the main.cpp file.

First, Eclipse complained about not finding the Printer.h include file in the autogenerated Printer.cpp file and the main.cpp code that I just copied from the manual. I change the include definition from <Printer.h> to "Printer.h" and the missing error disapeared.

Without doing anything, not tried to build the project yet, I am getting the following errors:
Description Resource Path Location Type
The type 'IceDelegateM::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::ice_ids' Printer.cpp /iceserver line 119 Code Analysis Problem
The type 'IceDelegateM::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::ice_id' Printer.cpp /iceserver line 119 Code Analysis Problem
/iceserver line 125 Code Analysis Problem ...
Many more like that.


If I am trying to build the project, I am getting a lot more errors:
The type 'IceDelegateD::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::ice_flushBatchRequests' Printer.cpp /iceserver line 125 Code Analysis Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 186, external location: /usr/include/Ice/Handle.h C/C++ Problem
The type 'IceDelegateD::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::ice_invoke' Printer.cpp /iceserver line 125 Code Analysis Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 178, external location: /usr/include/Ice/Handle.h C/C++ Problem
The type 'IceDelegateD::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::__getRequestHandler' Printer.cpp /iceserver line 125 Code Analysis Problem
The type 'IceDelegateM::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::ice_isA' Printer.cpp /iceserver line 119 Code Analysis Problem
required from here iceserver line 161, external location: /usr/include/Ice/Proxy.h C/C++ Problem
required from here Printer.h /iceserver line 163 C/C++ Problem
make: *** [Printer.o] Error 1 iceserver C/C++ Problem
The type 'IceDelegateM::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::ice_flushBatchRequests' Printer.cpp /iceserver line 119 Code Analysis Problem
required from ‘static IceInternal::Handle<T> IceInternal::Handle<T>::dynamicCast(const IceUtil::HandleBase<Y>&) [with Y = Ice::Object; T = Demo::Printer; IceInternal::Handle<T> = IceInternal::Handle<Demo::Printer>]’ iceserver line 198, external location: /usr/include/Ice/Handle.h C/C++ Problem
The type 'IceDelegateM::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::ice_invoke' Printer.cpp /iceserver line 119 Code Analysis Problem
The type 'IceDelegateM::Demo::Printer' must implement the inherited pure virtual method 'IceDelegate::Ice::Object::__getRequestHandler' Printer.cpp /iceserver line 119 Code Analysis Problem
required from here iceserver line 24, external location: /usr/include/Ice/Direct.h C/C++ Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 106, external location: /usr/include/Ice/Handle.h C/C++ Problem
required from here iceserver line 49, external location: /usr/include/Ice/OutgoingAsync.h C/C++ Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 66, external location: /usr/include/Ice/Handle.h C/C++ Problem
required from here iceserver line 77, external location: /usr/include/Ice/Current.h C/C++ Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 258, external location: /usr/include/Ice/ProxyHandle.h C/C++ Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 253, external location: /usr/include/Ice/ProxyHandle.h C/C++ Problem
required from here iceserver line 953, external location: /usr/include/Ice/Proxy.h C/C++ Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 199, external location: /usr/include/Ice/ProxyHandle.h C/C++ Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 194, external location: /usr/include/Ice/ProxyHandle.h C/C++ Problem
required from here Printer.cpp /iceserver line 241 C/C++ Problem
required from here Printer.cpp /iceserver line 387 C/C++ Problem
‘upCast’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] iceserver line 144, external
... many more

In my Eclipse C/C++ Build->Settings->Libraries, I add the -l Ice and IceUtil libraries.

What I am doing wrong? Is there a bug in the autogenerated code? I read about a bug and a little patch on this site, but don't know if it is related with my problem.

Any help would be appreciated.

Thanks

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Eclipse C++ isn't officially supported and we don't have much experience with it. I recommend to try with the newly released Ice 3.5.0 (we only provide free support for the latest Ice version on the forums). It looks like the errors are coming from the Eclipse code analysis. Which compiler is it using under the hood? I would recommend to first try to compile the generated code on the command line, it should build without errors:
    $ slice2cpp Printer.ice
    $ gcc -I. -c Printer.cpp
    

    You should add -I. to your compiler options to not have to change the #include <> to a #include "".

    Cheers,
    Benoit.