You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Manish Raje <ma...@gmail.com> on 2009/07/17 19:24:13 UTC

Error compiling Active MQ CPP API on SunOS 10 with Sun Studio 12 compiler

Hi There

I'm trying to compile 64bit version of Active MQ CPP API release 3.0.1 on
Solaris 10 using Sun Studio 12 compiler -
CC: Sun C++ 5.9 SunOS_sparc 2007/05/03

The build is failing with below errors while trying to compile
ActiveMQBlobMessage.cpp -

libtool: compile:  /home/SUNWspro12/bin/CC -DHAVE_CONFIG_H -I. -I../..
-xarch=v9 -mt -w -O5 -library=stlport4 -DSOLARIS2=10
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
-I/local/APR/APR-lib/apr-1.3.6-build/include/apr-1
-I/local/APR/APR-Util/INSTALL/include/apr-1 -PIC -xarch=v9 -c
activemq/commands/ActiveMQBlobMessage.cpp  -KPIC -DPIC -o
activemq/commands/.libs/libactivemq_cpp_la-ActiveMQBlobMessage.o
CC: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
CC: Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs
"./activemq/util/PrimitiveValueConverter.h", line 72: Error: Could not find
a match for
activemq::util::PrimitiveValueConverter::convert<activemq::util::PrimitiveValueConverter::TO>(const
activemq::util::PrimitiveValueNode&) const.
"./activemq/util/PrimitiveValueConverter.h", line 75: Error: Could not find
a match for
activemq::util::PrimitiveValueConverter::convert<activemq::util::PrimitiveValueConverter::TO>(const
activemq::util::PrimitiveValueNode&) const.
...

Has anyone faced this issue? Any pointers/help is appreaciated.

Thanks in advance,
Manish.
-- 
View this message in context: http://www.nabble.com/Error-compiling-Active-MQ-CPP-API-on-SunOS-10-with-Sun-Studio-12-compiler-tp24538512p24538512.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: Error compiling Active MQ CPP API on SunOS 10 with Sun Studio 12 compiler

Posted by Seb Rose <na...@claysnow.co.uk>.
Here's the file we're using:

/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _ACTIVEMQ_UTIL_PRIMITIVEVALUECONVERTER_H_
#define _ACTIVEMQ_UTIL_PRIMITIVEVALUECONVERTER_H_

#include <activemq/util/Config.h>

#include <activemq/util/PrimitiveValueNode.h>
#include <decaf/lang/exceptions/UnsupportedOperationException.h>
#include <string>

namespace activemq {
namespace util {

    /**
     * Class controls the conversion of data contained in a
PrimitiveValueNode
     * from one type to another.  If the conversion is supported then
calling
     * the convert method will throw an UnsupportedOperationException to
indicate
     * that its not possible to perform the conversion.
     *
     * This class is used to implement the rules of conversion on CMS
Message
     * properties, the following conversion table must be implemented.  A
value
     * written as the row type can be read in the column type.
     *
     *    |        | boolean byte short int long float double String
     *    |----------------------------------------------------------
     *    |boolean |    X                                       X
     *    |byte    |          X     X    X   X                  X
     *    |short   |                X    X   X                  X
     *    |int     |                     X   X                  X
     *    |long    |                         X                  X
     *    |float   |                               X     X      X
     *    |double  |                                     X      X
     *    |String  |    X     X     X    X   X     X     X      X
     *    |----------------------------------------------------------
     *
     * @since 3.0
     */
    class AMQCPP_API PrimitiveValueConverter {
    public:

        PrimitiveValueConverter() {}
        virtual ~PrimitiveValueConverter() {}

        template< typename TO>
        TO convert( const PrimitiveValueNode& value ) const
            throw ( decaf::lang::exceptions::UnsupportedOperationException )
{

            throw decaf::lang::exceptions::UnsupportedOperationException(
                __FILE__, __LINE__, "Invalid Conversion" );
        }

    };

    template<>
    bool PrimitiveValueConverter::convert<bool>( const PrimitiveValueNode&
value ) const 
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    unsigned char PrimitiveValueConverter::convert<unsigned char>( const
PrimitiveValueNode& value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    char PrimitiveValueConverter::convert<char>( const PrimitiveValueNode&
value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    short PrimitiveValueConverter::convert<short>( const PrimitiveValueNode&
value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    int PrimitiveValueConverter::convert<int>( const PrimitiveValueNode&
value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    long long PrimitiveValueConverter::convert<long long>( const
PrimitiveValueNode& value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    float PrimitiveValueConverter::convert<float>( const PrimitiveValueNode&
value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    double PrimitiveValueConverter::convert<double>( const
PrimitiveValueNode& value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    std::string PrimitiveValueConverter::convert<std::string>( const
PrimitiveValueNode& value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );
    template<>
    std::vector<unsigned char>
PrimitiveValueConverter::convert<std::vector<unsigned char> >( const
PrimitiveValueNode& value ) const
        throw( decaf::lang::exceptions::UnsupportedOperationException );

}}

#endif /* _ACTIVEMQ_UTIL_PRIMITIVEVALUECONVERTER_H_ */


-- 
View this message in context: http://old.nabble.com/Error-compiling-Active-MQ-CPP-API-on-SunOS-10-with-Sun-Studio-12-compiler-tp24538512p27902434.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: Error compiling Active MQ CPP API on SunOS 10 with Sun Studio 12 compiler

Posted by Radha Manickam <ra...@gmail.com>.
Hi,

Will u please show me the exact changes that you did in the file.

Regards,
Radha.

-- 
View this message in context: http://old.nabble.com/Error-compiling-Active-MQ-CPP-API-on-SunOS-10-with-Sun-Studio-12-compiler-tp24538512p27862214.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Error compiling Active MQ CPP API on SunOS 10 with Sun Studio 12 compiler

Posted by Seb Rose <na...@claysnow.co.uk>.
We experienced the same problem.

It turned out to be a deficiency in the compiler. It wasn't deducing
the template parameter from the return type. 

We edited the file (PrimitiveValueConverter.h),
supplying full explicit specializations and it compiled OK

e.g. (from memory):
template<> bool ClassName::convertTo<bool>(Parameter& p){}


-- 
View this message in context: http://old.nabble.com/Error-compiling-Active-MQ-CPP-API-on-SunOS-10-with-Sun-Studio-12-compiler-tp24538512p26594247.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.