You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by anju_singh <as...@websense.com> on 2008/07/25 05:11:53 UTC

Unable to compile actviemq-cpp-2.2 with VS2003

Hi,

Changed the version in 2005 vcproject file (vs2005-activemq.vcproj) to 7.10
and tried to compile it with VS2003.
Got errors that looked like (not posting all, just a few to keep the post
readable)
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
..\src\main\activemq\connector\ConnectorException.h(80) : error C2511:
'decaf::lang::Throwable
*activemq::connector::ConnectorException::clone(void)' : overloaded member
function not found in 'activemq::connector::ConnectorException'
        ..\src\main\activemq\connector\ConnectorException.h(29) : see
declaration of 'activemq::connector::ConnectorException'
..\src\main\activemq\connector\ConnectorException.h(80) : error C2511:
'activemq::exceptions::ActiveMQException
*activemq::connector::ConnectorException::clone(void)' : overloaded member
function not found in 'activemq::connector::ConnectorException'
        ..\src\main\activemq\connector\ConnectorException.h(29) : see
declaration of 'activemq::connector::ConnectorException'
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------

VS2005 compiler doesn't complain about this but VS2003 compiler does.

Investigated a bit to find out that the return type of virtual function
clone() is different in the inherited classes.  
For e.g:
----------------------------------------------------------------------------------------------------
for ConnectorException : public exceptions::ActiveMQException

        virtual ConnectorException* clone() const{
            return new ConnectorException( *this );
        }

----------------------------------------------------------------------------------------------------
Return type above is ConnectorException*

but the base class has following definition:
----------------------------------------------------------------------------------------------------
virtual ActiveMQException* clone() const;
----------------------------------------------------------------------------------------------------
Return type above is ActiveMQException*

I feel this is not right. Cloning should return the base type.
Moreover VS2003 compiler is pretty unhappy about it.

Please let me know what you guys think about this. Meanwhile I have changed
it in my activemq-cpp distribution to cheer up the compiler.

Thanks,
Anju



-- 
View this message in context: http://www.nabble.com/Unable-to-compile-actviemq-cpp-2.2-with-VS2003-tp18644453p18644453.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Unable to compile actviemq-cpp-2.2 with VS2003

Posted by Timothy Bish <ta...@gmail.com>.
VC2003 does not support covariant return types, along with other ANSI
defined C++ language features and won't work with ActiveMQ-CPP. 

Regards
Tim.

On Thu, 2008-07-24 at 20:11 -0700, anju_singh wrote:
> Hi,
> 
> Changed the version in 2005 vcproject file (vs2005-activemq.vcproj) to 7.10
> and tried to compile it with VS2003.
> Got errors that looked like (not posting all, just a few to keep the post
> readable)
> -----------------------------------------------------------------------------------------------------
> -----------------------------------------------------------------------------------------------------
> ..\src\main\activemq\connector\ConnectorException.h(80) : error C2511:
> 'decaf::lang::Throwable
> *activemq::connector::ConnectorException::clone(void)' : overloaded member
> function not found in 'activemq::connector::ConnectorException'
>         ..\src\main\activemq\connector\ConnectorException.h(29) : see
> declaration of 'activemq::connector::ConnectorException'
> ..\src\main\activemq\connector\ConnectorException.h(80) : error C2511:
> 'activemq::exceptions::ActiveMQException
> *activemq::connector::ConnectorException::clone(void)' : overloaded member
> function not found in 'activemq::connector::ConnectorException'
>         ..\src\main\activemq\connector\ConnectorException.h(29) : see
> declaration of 'activemq::connector::ConnectorException'
> -----------------------------------------------------------------------------------------------------
> -----------------------------------------------------------------------------------------------------
> 
> VS2005 compiler doesn't complain about this but VS2003 compiler does.
> 
> Investigated a bit to find out that the return type of virtual function
> clone() is different in the inherited classes.  
> For e.g:
> ----------------------------------------------------------------------------------------------------
> for ConnectorException : public exceptions::ActiveMQException
> 
>         virtual ConnectorException* clone() const{
>             return new ConnectorException( *this );
>         }
> 
> ----------------------------------------------------------------------------------------------------
> Return type above is ConnectorException*
> 
> but the base class has following definition:
> ----------------------------------------------------------------------------------------------------
> virtual ActiveMQException* clone() const;
> ----------------------------------------------------------------------------------------------------
> Return type above is ActiveMQException*
> 
> I feel this is not right. Cloning should return the base type.
> Moreover VS2003 compiler is pretty unhappy about it.
> 
> Please let me know what you guys think about this. Meanwhile I have changed
> it in my activemq-cpp distribution to cheer up the compiler.
> 
> Thanks,
> Anju
> 
> 
>