[omniORB] Strange problems

Robert Simmons Jr. gnuish@uswest.net
Fri, 17 Sep 1999 09:03:32 -0600


I have been working on an issue for like 3 hours now and Im totally
befuddled.  I wrote a small little demo server and tried to compile just
the impl. Here is the code.

// File: TZProConvert_i.hh
// *** General Includes ***
#include <string.h>

// *** ORB Includes ***

// *** TZPro Includes ***
#include "TZProConvert.hh"
#include "TZPro.h"

// *** Code Section  ***

class TZProConvert_i : public virtual _sk_TZProConvert {
  public:
    // Constructor
    TZProConvert_i();
    // Output the version info as a string.
    virtual char * getVersion();
};


// File: TZProConvert_i.cc
#include "TZProConvert_i.h"

// Constructor
TZProConvert_i::TZProConvert_i() {
}

// Output the version info as a string.
char *
TZProConvert_i::getVersion() {
  char *buf = CORBA::string_dup(VERSIONINFO);
  return buf;
}

Pretty simple huh ? I thought so. BOY was I wrong. I tried to compile it
and I get the following:
[derisor@derisor src]$ make convertimpl
g++ -D__x86__ -D__linux__  -D__OSVERSION__=2 -D_REENTRANT -O2 -c
-fexceptions -Wall -I. -I/usr/local/include/omniORB/
-I/usr/local/include/omniORB/omniORB2/ TZProConvert_i.cc -o
TZProConvert_i.o
In file included from TZProConvert_i.cc:12:
TZProConvert_i.h:28: parse error before `{'
TZProConvert_i.h:33: virtual outside class declaration
TZProConvert_i.h:34: parse error before `}'
TZProConvert_i.cc:15: invalid use of undefined type `class
TZProConvert_i'
TZProConvert_i.h:28: forward declaration of `class TZProConvert_i'
TZProConvert_i.cc:20: invalid use of undefined type `class
TZProConvert_i'
TZProConvert_i.h:28: forward declaration of `class TZProConvert_i'
make: *** [TZProConvert_i.o] Error 1
[derisor@derisor src]$ gless TZProConvert_i.hh

Parse error ? Initially I thought I missed a quote in an include file or
maybe a brace. Nope. I even went to comenting out each include and
ingoring the undefined sumbol errors but I still got the parse error. It
gets stranger.  If I take off everythign after the class name in the
header ... like

class TZProConvert_i  {
  public:
    // Constructor
    TZProConvert_i();
    // Output the version info as a string.
    virtual char * getVersion();
};

Then I dont get the parse error. Something is royally screwed here. I
cant figure it out. (I know when its pointed out ill prolly smack myself
for it being so dumb but Ive stared at it and cant figure it out.) Whats
more, I cant inherit anything. In case it was a problem with the sk
class I did this :

class TZProConvert_i : public foo{
  public:
    // Constructor
    TZProConvert_i();
    // Output the version info as a string.
    virtual char * getVersion();
};

Knowing that id get an undefined type on foo. NOPE. PARSE ERROR again.
What is this ? Does GCC 2.95.1 not support inheritance ? =) No wait I
know it does cause i can build the orb and all the examples with it and
they run fine. Im totally mystified. I would appreciate someone
enlightening me here.

--rob