Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8327487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:07:38+00:00 2026-06-09T01:07:38+00:00

For over 3 days I’ve been dealing with CORBA and C++ and my app

  • 0

For over 3 days I’ve been dealing with CORBA and C++ and my app interface written in IDL.

My app interface looks like this:

#ifndef __FORUM_INTERFACE_IDL__
#define __FORUM_INTERFACE_IDL__

#include "Forum.idl"
typedef sequence<Forum> Forums;

interface ForumInterface
{
    Forums getForumList(in Forum f);
    Forums getUsersForumList(in long UsersID);
    void addNewTopic(in Forum f, in long UsersID, in string title);
};

#endif

I “compile” it to *.hh and *.cc files by : omniidl -bcxx ForumInterface.idl

My Forum-object (also defined in IDL) looks like:

#ifndef __FORUM_IDL__
#define __FORUM_IDL__

interface Forum
{
    long getForumID();
    void setForumID(in long id);
    string getForumName();
    void setFroumName(in string name);
    Forum getForumParent();
    void setForumParent(in Forum f);
};

#endif

I “compile” it to *.hh and *.cc files by : omniidl -bcxx Forum.idl

I tried to write an implementation of both Forum and ForumInterface. I started with Forum, here’s definition of class FroumImpl:

#ifndef __FORUMIMPL_H__
#define __FORUMIMPL_H__

#include "Forum.hh"

class ForumImpl : public POA_Forum
{
    private :

        long id;
        char *name;
        ForumImpl parent;

    public :

        long getForumID();
        void setForumID(long id);
        char* getForumName();
        void setFroumName(const char* name);
        ForumImpl getForumParent();
        void setForumParent(ForumImpl f);
};

#endif

and it’s declaration (for now it’s empty):

#include "ForumImpl.h"

long ForumImpl::getForumID(){}
void ForumImpl::setForumID(long id){}
char* ForumImpl::getForumName(){}
void ForumImpl::setFroumName(const char* name){}
ForumImpl ForumImpl::getForumParent(){}
void ForumImpl::setForumParent(ForumImpl f){}

I tried to compile it,

g++ -c ForumImpl.cpp -I$OMNIORB_HOME/include -I$OMNIORB_HOME/include/omniORB4

but got errors:

In file included from ForumImpl.cpp:1:0: ForumImpl.h:12:19: error:
field ‘parent’ has incomplete type ForumImpl.h:20:19: error:
conflicting return type specified for ‘virtual ForumImpl
ForumImpl::getForumParent()’ Forum.hh:161:21: error: overriding
‘virtual _objref_Forum* _impl_Forum::getForumParent()’
ForumImpl.h:20:19: error: invalid abstract return type for member
function ‘virtual ForumImpl ForumImpl::getForumParent()’
ForumImpl.h:6:7: note: because the following virtual functions are
pure within ‘ForumImpl’: Forum.hh:162:16: note: virtual void
_impl_Forum::setForumParent(Forum_ptr) ForumImpl.h:21:14: error: cannot declare parameter ‘f’ to be of abstract type ‘ForumImpl’
ForumImpl.h:6:7: note: since type ‘ForumImpl’ has pure virtual
functions ForumImpl.cpp: In member function ‘virtual ForumImpl
ForumImpl::getForumParent()’: ForumImpl.cpp:7:11: error: invalid
abstract return type for member function ‘virtual ForumImpl
ForumImpl::getForumParent()’ ForumImpl.h:6:7: note: since type
‘ForumImpl’ has pure virtual functions ForumImpl.cpp: At global scope:
ForumImpl.cpp:8:42: error: cannot declare parameter ‘f’ to be of
abstract type ‘ForumImpl’ ForumImpl.h:6:7: note: since type
‘ForumImpl’ has pure virtual functions

the worst thing is I have no idea why this code gives me such errors … I mean, I defined all of ForumImpl functions … so any of them is virtual now. I spent hours and hours trying figure out what’s wrong with this but have no clue 🙁

Could anyone help? My files: http://www6.zippyshare.com/v/69552292/file.html I added to this tar archive a Makefile, so simply run command “make all” and this will do everything.

I would be very grateful if anyone could tell my why I got those error and what to do to fix this, I really need it. Cheers:)

EDIT:

I changed my ForumImpl.h and ForumImpl.cpp:

#ifndef __FORUMIMPL_H__
#define __FORUMIMPL_H__

#include "Forum.hh"

class ForumImpl : public POA_Forum
{
    private :

        long id;
        char *name;
        ForumImpl *parent;

    public :

        long getForumID();
        void setForumID(long id);
        char* getForumName();
        void setFroumName(const char* name);
        ForumImpl* getForumParent();
        void setForumParent(ForumImpl *f);
};

#endif

#include "ForumImpl.h"
long ForumImpl::getForumID(){}
void ForumImpl::setForumID(long id){}
char* ForumImpl::getForumName(){}
void ForumImpl::setFroumName(const char* name){}
ForumImpl* ForumImpl::getForumParent(){}
void ForumImpl::setForumParent(ForumImpl *f){}

but this gave me those erros:

g++ -c ForumImpl.cpp -IMNIORB_HOME/include
-IMNIORB_HOME/include/omniORB4 In file included from ForumImpl.cpp:1:0: ForumImpl.h:20:20: error: invalid covariant return
type for ‘virtual ForumImpl* ForumImpl::getForumParent()’
Forum.hh:161:21: error: overriding ‘virtual _objref_Forum*
_impl_Forum::getForumParent()’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:07:39+00:00Added an answer on June 9, 2026 at 1:07 am

    The signature for ForumImpl::getForumParent() should look like this:

    Forum_ptr getForumParent();
    

    For more information you should download the IDL to C++ mapping document from the OMG website. Also check out Henning & Vinowski’s book Advanced CORBA Programming with C++.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been puzzling over this for a few days... feel free to shoot down
i've been pulling my hair over this a few days, I'm trying to setup
I've been driving myself crazy over the past few days over this one. We've
I have been banging my head on the desk for several days over this
I've been working on this problem for over 3 days. :=[ I am trying
I have been tweaking a regular expression over several days to try to capture,
There have been several questions over the past few days about the proper use
I've been playing around with Dojo over the last couple of days. The script
I've been teaching myself Dojo over the last few days. However, if you look
For the past few days I have been trying to play any sound over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.