By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,314 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,314 IT Pros & Developers. It's quick & easy.

expected unqualified-id before : token

P: 77
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):
Expand|Select|Wrap|Line Numbers
  1. #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) 
  2.     : AUX778076_OP_IMPL_NAME<    
  3.           typename AUX778076_OP_TAG_NAME<N1>::type
  4.         , typename AUX778076_OP_TAG_NAME<N2>::type
  5.         >::template apply<N1,N2>::type
  6. #else
  7.     : aux::msvc_eti_base< typename apply_wrap2<
  8.           AUX778076_OP_IMPL_NAME<
  9.               typename AUX778076_OP_TAG_NAME<N1>::type
  10.             , typename AUX778076_OP_TAG_NAME<N2>::type
  11.             >
  12.         , N1
  13.         , N2
  14.         >::type >::type
  15. #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
Mar 29 '11 #1
Share this Question
Share on Google+
5 Replies


Banfa
Expert Mod 5K+
P: 8,916
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.
Mar 29 '11 #2

P: 77
This is the full stack
Expand|Select|Wrap|Line Numbers
  1. compiling OneWayMuxImpl.cpp (g++)
  2. In file included from /opt/boost_1_33_1/boost/mpl/aux_/arithmetic_op.hpp:26,
  3.                  from /opt/boost_1_33_1/boost/mpl/plus.hpp:19,
  4.                  from /opt/boost_1_33_1/boost/mpl/vector/aux_/iterator.hpp:19,
  5.                  from /opt/boost_1_33_1/boost/mpl/vector/aux_/vector0.hpp:22,
  6.                  from /opt/boost_1_33_1/boost/mpl/vector/aux_/clear.hpp:18,
  7.                  from /opt/boost_1_33_1/boost/mpl/vector/vector0.hpp:24,
  8.                  from /opt/boost_1_33_1/boost/mpl/vector/vector10.hpp:18,
  9.                  from /opt/boost_1_33_1/boost/mpl/vector/vector20.hpp:18,
  10.                  from /opt/boost_1_33_1/boost/mpl/vector/vector30.hpp:18,
  11.                  from /opt/boost_1_33_1/boost/mpl/vector/vector40.hpp:18,
  12.                  from /opt/boost_1_33_1/boost/mpl/vector/vector50.hpp:18,
  13.                  from /opt/boost_1_33_1/boost/mpl/vector.hpp:36,
  14.                  from /home/mahmood/flexus-4.0/core/metaprogram.hpp:57,
  15.                  from /home/mahmood/flexus-4.0/core/configuration.hpp:50,
  16.                  from /home/mahmood/flexus-4.0/core/simulator_layout.hpp:83,
  17.                  from /home/mahmood/flexus-4.0/components/Common/OneWayMux.hpp:39,
  18.                  from OneWayMuxImpl.cpp:39:
  19. /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:39
Expand|Select|Wrap|Line Numbers
  1. #include <components/Common/OneWayMux.hpp>
OneWayMux.hpp:39
Expand|Select|Wrap|Line Numbers
  1. #include <core/simulator_layout.hpp>

simulator_layout.hpp:83
Expand|Select|Wrap|Line Numbers
  1.   #define FLEXUS_IMPLEMENTATION_FILE
  2.  
  3.   #include <core/types.hpp>
  4.   #include <core/debug/debug.hpp>
  5.   #include <core/component.hpp>
  6.   #include <core/configuration.hpp>

configuration.hpp:50
Expand|Select|Wrap|Line Numbers
  1. #include <core/metaprogram.hpp>
metaprogram.hpp:57
Expand|Select|Wrap|Line Numbers
  1. #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  2. #include <boost/mpl/vector.hpp>
  3.  
  4. #undef BOOST_MPL_NO_PREPROCESSED_HEADERS
vector.hpp:36
Expand|Select|Wrap|Line Numbers
  1. #   include BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_HEADER)
  2. #   undef AUX778076_VECTOR_HEADER
vector50.hpp:18
Expand|Select|Wrap|Line Numbers
  1. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  2. #   include <boost/mpl/vector/vector40.hpp>
  3. #endif
vector40.hpp:18
Expand|Select|Wrap|Line Numbers
  1. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  2. #   include <boost/mpl/vector/vector30.hpp>
  3. #endif
vector30.hpp:18
Expand|Select|Wrap|Line Numbers
  1. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  2. #   include <boost/mpl/vector/vector20.hpp>
  3. #endif
vector20.hpp:18
Expand|Select|Wrap|Line Numbers
  1. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  2. #   include <boost/mpl/vector/vector10.hpp>
  3. #endif
vector10.hpp:18
Expand|Select|Wrap|Line Numbers
  1. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  2. #   include <boost/mpl/vector/vector0.hpp>
  3. #endif
vector0.hpp:24
Expand|Select|Wrap|Line Numbers
  1. #include <boost/mpl/vector/aux_/clear.hpp>
clear.hpp:18
Expand|Select|Wrap|Line Numbers
  1. #include <boost/mpl/vector/aux_/vector0.hpp>
vector0.hpp:22
Expand|Select|Wrap|Line Numbers
  1. #include <boost/mpl/vector/aux_/iterator.hpp>
iterator.hpp:19
Expand|Select|Wrap|Line Numbers
  1. #include <boost/mpl/plus.hpp>
plus.hpp:19
Expand|Select|Wrap|Line Numbers
  1. #include <boost/mpl/aux_/arithmetic_op.hpp>
arithmetic_op.hpp:26
Expand|Select|Wrap|Line Numbers
  1. #include <boost/mpl/aux_/numeric_op.hpp>
numeric_op.hpp:250
Expand|Select|Wrap|Line Numbers
  1. #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) 
  2.     : AUX778076_OP_IMPL_NAME<
  3.           typename AUX778076_OP_TAG_NAME<N1>::type
  4.         , typename AUX778076_OP_TAG_NAME<N2>::type
  5.         >::template apply<N1,N2>::type
  6. #else
  7.     : aux::msvc_eti_base< typename apply_wrap2<
  8.           AUX778076_OP_IMPL_NAME<
  9.               typename AUX778076_OP_TAG_NAME<N1>::type
  10.             , typename AUX778076_OP_TAG_NAME<N2>::type
  11.             >
  12.         , N1
  13.         , N2
  14.         >::type >::type
  15. #endif
I hope I provide the right information you wanted
Mar 29 '11 #3

Banfa
Expert Mod 5K+
P: 8,916
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.
Mar 29 '11 #4

P: 77
Sorry for that. You may find this code snippet.
Expand|Select|Wrap|Line Numbers
  1. {
  2.     BOOST_MPL_AUX_LAMBDA_SUPPORT(
  3.           AUX778076_OP_ARITY
  4.         , AUX778076_OP_NAME
  5.         , ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) )
  6.         )
  7. };
  8.  
  9. template< 
  10.       typename N1
  11.     , typename N2
  12.     >
  13. struct BOOST_PP_CAT(AUX778076_OP_NAME,2)
  14.  
  15. #endif
  16.  
  17. #else // AUX778076_OP_ARITY == 2
  18.  
  19. template< 
  20.       typename BOOST_MPL_AUX_NA_PARAM(N1)
  21.     , typename BOOST_MPL_AUX_NA_PARAM(N2)
  22.     >
  23. struct AUX778076_OP_NAME
  24.  
  25. #endif
  26.  
  27. #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) 
  28.     : AUX778076_OP_IMPL_NAME<          // EERROORR
  29.           typename AUX778076_OP_TAG_NAME<N1>::type
  30.         , typename AUX778076_OP_TAG_NAME<N2>::type
  31.         >::template apply<N1,N2>::type
  32. #else
  33.     : aux::msvc_eti_base< typename apply_wrap2<
  34.           AUX778076_OP_IMPL_NAME<
  35.               typename AUX778076_OP_TAG_NAME<N1>::type
  36.             , typename AUX778076_OP_TAG_NAME<N2>::type
  37.             >
  38.         , N1
  39.         , N2
  40.         >::type >::type
  41. #endif
  42. {
  43. #if AUX778076_OP_ARITY != 2
  44.  
  45. #   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
  46.     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
  47.           AUX778076_OP_ARITY
  48.         , AUX778076_OP_NAME
  49.         , ( BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(2, N, na) )
  50.         )
  51. #   else
  52.     BOOST_MPL_AUX_LAMBDA_SUPPORT(2, BOOST_PP_CAT(AUX778076_OP_NAME,2), (N1, N2))
  53. #   endif
  54.  
  55. #else
  56.     BOOST_MPL_AUX_LAMBDA_SUPPORT(2, AUX778076_OP_NAME, (N1, N2))
  57. #endif
  58. };
  59.  
Mar 30 '11 #5

P: 77
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?
Mar 30 '11 #6

Post your reply

Sign in to post your reply or Sign up for a free account.