expected unqualified-id before ‘:’ token

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mahmoodn
    New Member
    • May 2009
    • 77

    expected unqualified-id before ‘:’ token

    I have a program which uses boost 1.33.1 and it works fine with gcc 4.1 however now that I want to compile with gcc 4.4 it get many errors. For example somewhere in the boost files, it says:
    /opt/boost_1_33_1/boost/mpl/aux_/numeric_op.hpp: 250: error: expected unqualified-id before ‘:’ token

    the code at that line is (note the second line):
    Code:
    #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) 
        : AUX778076_OP_IMPL_NAME<    
              typename AUX778076_OP_TAG_NAME<N1>::type
            , typename AUX778076_OP_TAG_NAME<N2>::type
            >::template apply<N1,N2>::type
    #else
        : aux::msvc_eti_base< typename apply_wrap2<
              AUX778076_OP_IMPL_NAME<
                  typename AUX778076_OP_TAG_NAME<N1>::type
                , typename AUX778076_OP_TAG_NAME<N2>::type
                >
            , N1
            , N2
            >::type >::type
    #endif
    I know that boost 1.33.1 is old however I checked numeric_op.hpp in the latest boost release at http://svn.boost.org/svn/boost/trunk/boost/mpl/aux_/numeric_op.hpp and it is the same as before.

    So any idea to solve that? thanks
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    We don't want an example of the errors, we want the first error or given that this is a template issue the first 5 - 10 errors.

    Once you have 1 error anything that follows is suspect because if may be on code that is correct but being interpreted incorrect because of that first error.

    Also when you post code post the whole statement, what you have posted looks like it might be the base class clause of a class definition but we can't tell because you've missed out the beginning of the statement.

    Comment

    • mahmoodn
      New Member
      • May 2009
      • 77

      #3
      This is the full stack
      Code:
      compiling OneWayMuxImpl.cpp (g++)
      In file included from /opt/boost_1_33_1/boost/mpl/aux_/arithmetic_op.hpp:26,
                       from /opt/boost_1_33_1/boost/mpl/plus.hpp:19,
                       from /opt/boost_1_33_1/boost/mpl/vector/aux_/iterator.hpp:19,
                       from /opt/boost_1_33_1/boost/mpl/vector/aux_/vector0.hpp:22,
                       from /opt/boost_1_33_1/boost/mpl/vector/aux_/clear.hpp:18,
                       from /opt/boost_1_33_1/boost/mpl/vector/vector0.hpp:24,
                       from /opt/boost_1_33_1/boost/mpl/vector/vector10.hpp:18,
                       from /opt/boost_1_33_1/boost/mpl/vector/vector20.hpp:18,
                       from /opt/boost_1_33_1/boost/mpl/vector/vector30.hpp:18,
                       from /opt/boost_1_33_1/boost/mpl/vector/vector40.hpp:18,
                       from /opt/boost_1_33_1/boost/mpl/vector/vector50.hpp:18,
                       from /opt/boost_1_33_1/boost/mpl/vector.hpp:36,
                       from /home/mahmood/flexus-4.0/core/metaprogram.hpp:57,
                       from /home/mahmood/flexus-4.0/core/configuration.hpp:50,
                       from /home/mahmood/flexus-4.0/core/simulator_layout.hpp:83,
                       from /home/mahmood/flexus-4.0/components/Common/OneWayMux.hpp:39,
                       from OneWayMuxImpl.cpp:39:
      /opt/boost_1_33_1/boost/mpl/aux_/numeric_op.hpp:250: error: expected unqualified-id before ‘:’ token
      The detail of each file at the mentioned line is:

      OneWayMux.cpp:3 9
      Code:
      #include <components/Common/OneWayMux.hpp>
      OneWayMux.hpp:3 9
      Code:
      #include <core/simulator_layout.hpp>

      simulator_layou t.hpp:83
      Code:
        #define FLEXUS_IMPLEMENTATION_FILE
      
        #include <core/types.hpp>
        #include <core/debug/debug.hpp>
        #include <core/component.hpp>
        #include <core/configuration.hpp>

      configuration.h pp:50
      Code:
      #include <core/metaprogram.hpp>
      metaprogram.hpp :57
      Code:
      #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
      #include <boost/mpl/vector.hpp>
      
      #undef BOOST_MPL_NO_PREPROCESSED_HEADERS
      vector.hpp:36
      Code:
      #   include BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_HEADER)
      #   undef AUX778076_VECTOR_HEADER
      vector50.hpp:18
      Code:
      #if !defined(BOOST_MPL_PREPROCESSING_MODE)
      #   include <boost/mpl/vector/vector40.hpp>
      #endif
      vector40.hpp:18
      Code:
      #if !defined(BOOST_MPL_PREPROCESSING_MODE)
      #   include <boost/mpl/vector/vector30.hpp>
      #endif
      vector30.hpp:18
      Code:
      #if !defined(BOOST_MPL_PREPROCESSING_MODE)
      #   include <boost/mpl/vector/vector20.hpp>
      #endif
      vector20.hpp:18
      Code:
      #if !defined(BOOST_MPL_PREPROCESSING_MODE)
      #   include <boost/mpl/vector/vector10.hpp>
      #endif
      vector10.hpp:18
      Code:
      #if !defined(BOOST_MPL_PREPROCESSING_MODE)
      #   include <boost/mpl/vector/vector0.hpp>
      #endif
      vector0.hpp:24
      Code:
      #include <boost/mpl/vector/aux_/clear.hpp>
      clear.hpp:18
      Code:
      #include <boost/mpl/vector/aux_/vector0.hpp>
      vector0.hpp:22
      Code:
      #include <boost/mpl/vector/aux_/iterator.hpp>
      iterator.hpp:19
      Code:
      #include <boost/mpl/plus.hpp>
      plus.hpp:19
      Code:
      #include <boost/mpl/aux_/arithmetic_op.hpp>
      arithmetic_op.h pp:26
      Code:
      #include <boost/mpl/aux_/numeric_op.hpp>
      numeric_op.hpp: 250
      Code:
      #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) 
          : AUX778076_OP_IMPL_NAME<
                typename AUX778076_OP_TAG_NAME<N1>::type
              , typename AUX778076_OP_TAG_NAME<N2>::type
              >::template apply<N1,N2>::type
      #else
          : aux::msvc_eti_base< typename apply_wrap2<
                AUX778076_OP_IMPL_NAME<
                    typename AUX778076_OP_TAG_NAME<N1>::type
                  , typename AUX778076_OP_TAG_NAME<N2>::type
                  >
              , N1
              , N2
              >::type >::type
      #endif
      I hope I provide the right information you wanted

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Actually I was hoping for a little more of numeric_op.hpp, the lines before what you have already posted but part from that very impressive detail.

        Comment

        • mahmoodn
          New Member
          • May 2009
          • 77

          #5
          Sorry for that. You may find this code snippet.
          Code:
          {
              BOOST_MPL_AUX_LAMBDA_SUPPORT(
                    AUX778076_OP_ARITY
                  , AUX778076_OP_NAME
                  , ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) )
                  )
          };
          
          template< 
                typename N1
              , typename N2
              >
          struct BOOST_PP_CAT(AUX778076_OP_NAME,2)
          
          #endif
          
          #else // AUX778076_OP_ARITY == 2
          
          template< 
                typename BOOST_MPL_AUX_NA_PARAM(N1)
              , typename BOOST_MPL_AUX_NA_PARAM(N2)
              >
          struct AUX778076_OP_NAME
          
          #endif
          
          #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) 
              : AUX778076_OP_IMPL_NAME<          // EERROORR
                    typename AUX778076_OP_TAG_NAME<N1>::type
                  , typename AUX778076_OP_TAG_NAME<N2>::type
                  >::template apply<N1,N2>::type
          #else
              : aux::msvc_eti_base< typename apply_wrap2<
                    AUX778076_OP_IMPL_NAME<
                        typename AUX778076_OP_TAG_NAME<N1>::type
                      , typename AUX778076_OP_TAG_NAME<N2>::type
                      >
                  , N1
                  , N2
                  >::type >::type
          #endif
          {
          #if AUX778076_OP_ARITY != 2
          
          #   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
              BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
                    AUX778076_OP_ARITY
                  , AUX778076_OP_NAME
                  , ( BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(2, N, na) )
                  )
          #   else
              BOOST_MPL_AUX_LAMBDA_SUPPORT(2, BOOST_PP_CAT(AUX778076_OP_NAME,2), (N1, N2))
          #   endif
          
          #else
              BOOST_MPL_AUX_LAMBDA_SUPPORT(2, AUX778076_OP_NAME, (N1, N2))
          #endif
          };

          Comment

          • mahmoodn
            New Member
            • May 2009
            • 77

            #6
            I find the solution fairly easy....
            I did a diff for numeric_op.hpp between 1.33.1 and current 1.46 (revision 70743) and found little differences in lines between two files. I did replace the old one with new one and the error disappeared.

            I want to upload the files but don't see any attachment link. Where can I upload the files?

            Comment

            Working...