[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mico-devel
Subject:    [mico-devel] NAMESPACES (MODULES) IGNORED WHEN COMPILING IDL
From:       "Brian Lindahl" <Brian.Lindahl () SpaceDev ! com>
Date:       2005-08-30 22:03:26
Message-ID: 069061BE1B26524C85EC01E0F5CC3CC30100CF57 () rigel ! headquarters ! spacedev ! com
[Download RAW message or body]

--===============81539829114311624==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C5ADAE.A573A3F1"

This is a multi-part message in MIME format.


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


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6944.0">
<TITLE>NAMESPACES (MODULES) IGNORED WHEN COMPILING IDL GENERATED CODE</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>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?<BR> <BR>
-----------------------------------------<BR>
IDL to duplicate problem:<BR>
<BR>
#ifndef SPDV_Current_idl<BR>
<BR>
#define SPDV_Current_idl<BR>
<BR>
<BR>
<BR>
module SPDV<BR>
<BR>
{<BR>
<BR>
&nbsp; struct Current<BR>
<BR>
&nbsp; {<BR>
<BR>
&nbsp;&nbsp;&nbsp; double value;<BR>
<BR>
&nbsp; };<BR>
<BR>
};<BR>
<BR>
<BR>
<BR>
#endif<BR>
<BR>
-----------------------------------------<BR>
Offending code (Current.cc):<BR>
<BR>
class _Marshaller_SPDV_Current : public ::CORBA::StaticTypeInfo {<BR>
&nbsp;&nbsp;&nbsp; typedef SPDV::Current _MICO_T;&nbsp;&nbsp;&nbsp; // &lt;---------- \
compiler gets confused here<BR> &nbsp; public:<BR>
&nbsp;&nbsp;&nbsp; ~_Marshaller_SPDV_Current();<BR>
&nbsp;&nbsp;&nbsp; StaticValueType create () const;<BR>
&nbsp;&nbsp;&nbsp; void assign (StaticValueType dst, const StaticValueType src) \
const;<BR> &nbsp;&nbsp;&nbsp; void free (StaticValueType) const;<BR>
&nbsp;&nbsp;&nbsp; ::CORBA::Boolean demarshal (::CORBA::DataDecoder&amp;, \
StaticValueType) const;<BR> &nbsp;&nbsp;&nbsp; void marshal (::CORBA::DataEncoder \
&amp;, StaticValueType) const;<BR> };<BR>
<BR>
-----------------------------------------<BR>
Compile-time error:<BR>
<BR>
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&nbsp; -DUSE_MICO -I../../src&nbsp; -c -fPIC -o \
.work-Linux-glibc-2.3-gcc-3.4/Current.so corba_generated/Current.cc<BR> \
corba_generated/Current.cc:39: error: `SPDV' has not been declared<BR> \
corba_generated/Current.cc:39: error: ISO C++ forbids declaration of `Current' with \
no type<BR> corba_generated/Current.cc:39: error: expected `;' before \
&quot;_MICO_T&quot;<BR> <BR>
-----------------------------------------<BR>
Subsequent errors (all related to the above, _MICO_T not being defined):<BR>
<BR>
corba_generated/Current.cc: In member function `virtual void* \
_Marshaller_SPDV_Current::create() const':<BR> corba_generated/Current.cc:56: error: \
expected primary-expression before ')' token<BR> corba_generated/Current.cc:56: \
error: expected `;' before &quot;new&quot;<BR> corba_generated/Current.cc:56: error: \
                `_MICO_T' has not been declared<BR>
corba_generated/Current.cc: In member function `virtual void \
_Marshaller_SPDV_Current::assign(void*, void*) const':<BR> \
corba_generated/Current.cc:61: error: `_MICO_T' undeclared (first use this \
function)<BR> corba_generated/Current.cc:61: error: (Each undeclared identifier is \
reported only once for each function it appears in.)<BR> \
corba_generated/Current.cc:61: error: expected primary-expression before ')' \
token<BR> corba_generated/Current.cc:61: error: expected `;' before &quot;d&quot;<BR>
corba_generated/Current.cc: In member function `virtual void \
_Marshaller_SPDV_Current::free(void*) const':<BR> corba_generated/Current.cc:66: \
error: `_MICO_T' undeclared (first use this function)<BR> \
corba_generated/Current.cc:66: error: expected primary-expression before ')' \
token<BR> corba_generated/Current.cc:66: error: expected `;' before &quot;v&quot;<BR>
corba_generated/Current.cc: In member function `virtual CORBA::Boolean \
_Marshaller_SPDV_Current::demarshal(CORBA::DataDecoder&amp;, void*) const':<BR> \
corba_generated/Current.cc:73: error: `_MICO_T' undeclared (first use this \
function)<BR> corba_generated/Current.cc:73: error: expected primary-expression \
before ')' token<BR> corba_generated/Current.cc:73: error: expected `)' before \
                &quot;v&quot;<BR>
corba_generated/Current.cc: In member function `virtual void \
_Marshaller_SPDV_Current::marshal(CORBA::DataEncoder&amp;, void*) const':<BR> \
corba_generated/Current.cc:80: error: `_MICO_T' undeclared (first use this \
function)<BR> corba_generated/Current.cc:80: error: expected primary-expression \
before ')' token<BR> corba_generated/Current.cc:80: error: expected `)' before \
                &quot;v&quot;<BR>
make: *** [.work-Linux-glibc-2.3-gcc-3.4/Current.so] Error 1<BR>
</FONT>
</P>

</BODY>
</HTML>



_______________________________________________
Mico-devel mailing list
Mico-devel@mico.org
http://www.mico.org/mailman/listinfo/mico-devel

--===============81539829114311624==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic