Title: NAMESPACES (MODULES) IGNORED WHEN COMPILING IDL GENERATED CODE

I've encountered an error with g++ 3.4 (uClinux) when trying to compile corba generated code from an IDL containing a simple structure called Current. It appears to trace back to the source code of the mico library where a symbol 'Current' is defined under the 'CORBA' namespace. Although the compile-time errors do not indicate such, it seems that the compiler is incapable of differentiating between CORBA::Current and SPDV::Current. Changing all references of 'Current' in the SPDV project to 'Current2' fixed the problem, but this is highly undesireable. Is there any work around to get the IDL to generate code that will ease the compiler's task at differentiating the two similiar symbols? Also, this really isn't the place to ask, but perhaps someone knows of a work around for the compiler itself?

-----------------------------------------
IDL to duplicate problem:

#ifndef SPDV_Current_idl

#define SPDV_Current_idl



module SPDV

{

  struct Current

  {

    double value;

  };

};



#endif

-----------------------------------------
Offending code (Current.cc):

class _Marshaller_SPDV_Current : public ::CORBA::StaticTypeInfo {
    typedef SPDV::Current _MICO_T;    // <---------- compiler gets confused here
  public:
    ~_Marshaller_SPDV_Current();
    StaticValueType create () const;
    void assign (StaticValueType dst, const StaticValueType src) const;
    void free (StaticValueType) const;
    ::CORBA::Boolean demarshal (::CORBA::DataDecoder&, StaticValueType) const;
    void marshal (::CORBA::DataEncoder &, StaticValueType) const;
};

-----------------------------------------
Compile-time error:

g++ -W -Wall -Wno-unused -pipe -O2 -MMD -MG -D_REENTRANT -D_POSIX_C_SOURCE=199506L -D_POSIX_PTHREAD_SEMANTICS -D_PTHREADS -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_GNU_SOURCE -D_POSIX_THREADS -I/home/tools/include  -DUSE_MICO -I../../src  -c -fPIC -o .work-Linux-glibc-2.3-gcc-3.4/Current.so corba_generated/Current.cc
corba_generated/Current.cc:39: error: `SPDV' has not been declared
corba_generated/Current.cc:39: error: ISO C++ forbids declaration of `Current' with no type
corba_generated/Current.cc:39: error: expected `;' before "_MICO_T"

-----------------------------------------
Subsequent errors (all related to the above, _MICO_T not being defined):

corba_generated/Current.cc: In member function `virtual void* _Marshaller_SPDV_Current::create() const':
corba_generated/Current.cc:56: error: expected primary-_expression_ before ')' token
corba_generated/Current.cc:56: error: expected `;' before "new"
corba_generated/Current.cc:56: error: `_MICO_T' has not been declared
corba_generated/Current.cc: In member function `virtual void _Marshaller_SPDV_Current::assign(void*, void*) const':
corba_generated/Current.cc:61: error: `_MICO_T' undeclared (first use this function)
corba_generated/Current.cc:61: error: (Each undeclared identifier is reported only once for each function it appears in.)
corba_generated/Current.cc:61: error: expected primary-_expression_ before ')' token
corba_generated/Current.cc:61: error: expected `;' before "d"
corba_generated/Current.cc: In member function `virtual void _Marshaller_SPDV_Current::free(void*) const':
corba_generated/Current.cc:66: error: `_MICO_T' undeclared (first use this function)
corba_generated/Current.cc:66: error: expected primary-_expression_ before ')' token
corba_generated/Current.cc:66: error: expected `;' before "v"
corba_generated/Current.cc: In member function `virtual CORBA::Boolean _Marshaller_SPDV_Current::demarshal(CORBA::DataDecoder&, void*) const':
corba_generated/Current.cc:73: error: `_MICO_T' undeclared (first use this function)
corba_generated/Current.cc:73: error: expected primary-_expression_ before ')' token
corba_generated/Current.cc:73: error: expected `)' before "v"
corba_generated/Current.cc: In member function `virtual void _Marshaller_SPDV_Current::marshal(CORBA::DataEncoder&, void*) const':
corba_generated/Current.cc:80: error: `_MICO_T' undeclared (first use this function)
corba_generated/Current.cc:80: error: expected primary-_expression_ before ')' token
corba_generated/Current.cc:80: error: expected `)' before "v"
make: *** [.work-Linux-glibc-2.3-gcc-3.4/Current.so] Error 1

_______________________________________________
Mico-devel mailing list
[email protected]
http://www.mico.org/mailman/listinfo/mico-devel

Reply via email to