[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppBoostCompileError

(C++) Boost compile errors

For STL compile errors see compile errors.

The more recent the version you use, the less compile errors you will have. For example, the Boost Graph library can be used without problems in Visual C++ 2005, but not in Visual C++ 6.0.

Using Google to find fixes for compile errors, sometimes adding one of the three defines below is suggested. Perhaps they will work for you?
  1. define BOOST_REGEX_USE_VCL
  2. define BOOST_NO_OPERATORS_IN_NAMESPACE
  3. define BOOST_NO_STD_LOCALE


Troubleshooting

Boost gives compile errors under C++ Builder 6.0

Boost is tested on the Borland compiler version 5.6.4. If you have an older version of this compiler, it won't work. You can check it out, by running /CBuilder6/Bin/Bcc32.exe (the compiler's name). This will let it give its version number. As a solution, you can either find somewhere (let me know if you know where) an updated version, or (what I did) I copied bcc32.exe from C++ BuilderX over the C++ Builder's bcc32.exe. This immediatly worked correct!

Some compile errors

Overview ( denotes solved, denotes unsolved yet):
  • (C++ Builder 6) [C++ Error] tuple_basic.hpp(156): E2238 Multiple declaration for 'element<N,T>'
  • (C++ Builder 6) [C++ Error] tuple_basic.hpp(741): E2451 Undefined symbol 'reference_wrapper'
  • (C++ Builder 6) [C++ Error] facade_iterator_category.hpp(158): E2439 'typename' is only allowed in template declarations
  • (C++ Builder 6) [C++ Error] tuple_basic.hpp(636): E2268 Call to undefined function 'BOOST_STATIC_ASSERT'
  • (C++ Builder 6) [C++ Error] if.hpp(66): E2401 Invalid template argument list
  • (Borland Developer Studio 2006) [C++ Error] lambda_traits.hpp(500): E2231 Member bind_type_generator<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>::nof_elems cannot be used without an object
  • (Visual Studio 6) lambda_fwd.hpp(26) : fatal error C1001: INTERNAL COMPILER ERROR
  • (Turbo C++ 2006) [C++ Error] is_enum.hpp(95): E2316 'is_convertible' is not a member of 'boost'
  • (Turbo C++ 2006) [C++ Error] template_arity.hpp(34): E2316 'has_rebind' is not a member of 'aux'
  • (Turbo C++ 2006) [C++ Error] is_abstract.hpp(117): E2316 'is_class' is not a member of 'boost'
  • (Turbo C++ 2006) [C++ Error] full_lambda.hpp(103): E2451 Undefined symbol 'quote1'

(C++ Builder 6) [C++ Error] tuple_basic.hpp(156): E2238 Multiple declaration for 'element<N,T>'

Happens when boost/tuple/detail/tuple_basic.hpp is #included. This header file is called among others from the graph library.

Writing the code below gets boost/tuple/detail/tuple_basic.hpp to compile:

  1. include <boost/ref.hpp>
  2. define BOOST_NO_CV_SPECIALIZATIONS
  3. include <boost/tuple/detail/tuple_basic.hpp>


(C++ Builder 6) [C++ Error] tuple_basic.hpp(741): E2451 Undefined symbol 'reference_wrapper'

Happens when you write
  1. define BOOST_NO_CV_SPECIALIZATIONS
  2. include <boost/tuple/detail/tuple_basic.hpp>


#include boost/ref.hpp first:

  1. include <boost/ref.hpp>
  2. define BOOST_NO_CV_SPECIALIZATIONS
  3. include <boost/tuple/detail/tuple_basic.hpp>


(C++ Builder 6) [C++ Error] facade_iterator_category.hpp(158): E2439 'typename' is only allowed in template declarations

In the original code below, remove the keyword typename

    BOOST_STATIC_ASSERT(
        !(is_convertible<
              typename iterator_category_to_traversal<Category>::type
            , Traversal
          >::value)); //Bilderbikkel: Error in this line


This will yield the code below, which works!
    BOOST_STATIC_ASSERT(
        !(is_convertible<
              iterator_category_to_traversal<Category>::type
            , Traversal
          >::value));


Do not do:

Writing the code below above the desired headers, changes the error to [C++ Error] if.hpp(66): E2401 Invalid template argument list, which is described below
  1. define BOOST_MSVC 1299
  2. include <boost/iterator/detail/facade_iterator_category.hpp>


(C++ Builder 6) [C++ Error] tuple_basic.hpp(636): E2268 Call to undefined function 'BOOST_STATIC_ASSERT'

Easy, just #include it:

  1. include <boost/static_assert.hpp>


Note that it does matter where you #include it. I had to put it first, do to some workaround #defines.

(C++ Builder 6) [C++ Error] if.hpp(66): E2401 Invalid template argument list

Happens if you write

  1. define BOOST_MSVC 1299
  2. include <boost/iterator/detail/facade_iterator_category.hpp>


The compiler takes you to the code below:

// agurt, 05/sep/04: nondescriptive parameter names for the sake of DigitalMars
// (and possibly MWCW < 8.0); see http://article.gmane.org/gmane.comp.lib.boost.devel/108959
template<
      typename BOOST_MPL_AUX_NA_PARAM(T1)
    , typename BOOST_MPL_AUX_NA_PARAM(T2)
    , typename BOOST_MPL_AUX_NA_PARAM(T3)
    >
struct if_
{
 private:
    // agurt, 02/jan/03: two-step 'type' definition for the sake of aCC
    typedef if_c<
  1. if defined(BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS)
BOOST_MPL_AUX_VALUE_WKND(T1)::value //Bilderbikkel: compiler goes this way
  1. else
BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(T1)::value)
  1. endif
, T2 , T3 //Bilderbikkel: Error caused by this line > almost_type_; public: typedef typename almost_type_::type type; BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(T1,T2,T3)) };


(Borland Developer Studio 2006) [C++ Error] lambda_traits.hpp(500): E2231 Member bind_type_generator<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>::nof_elems cannot be used without an object

No idea how to solve this

(Visual Studio 6) lambda_fwd.hpp(26) : fatal error C1001: INTERNAL COMPILER ERROR

Happens on #include <boost/lambda/lambda.hpp>. The full error message is:

d:\program files\microsoft visual studio\vc98\include\boost\lambda\detail\lambda_fwd.hpp(26) : 
  fatal error C1001: INTERNAL COMPILER ERROR
  (compiler file 'msc1.cpp', line 1786) 
Please choose the Technical Support command on the Visual C++ 
  Help menu, or open the Technical Support help file for more information


No idea how to solve it

(Turbo C++ 2006) [C++ Error] is_enum.hpp(95): E2316 'is_convertible' is not a member of 'boost'

Can be produced by the following program:
  1. include <boost/graph/adjacency_list.hpp>
int main() { boost::adjacency_list g; }


Solution: #include type_traits first.

  1. include <boost/type_traits.hpp>
  2. include <boost/graph/adjacency_list.hpp>
int main() { boost::adjacency_list<> g; }


This will result in another compile error, '[C++ Error] template_arity.hpp(34): E2316 'has_rebind' is not a member of 'aux''

(Turbo C++ 2006) [C++ Error] template_arity.hpp(34): E2316 'has_rebind' is not a member of 'aux'

Happens in the code below:

  1. include <boost/type_traits.hpp>
  2. include <boost/graph/adjacency_list.hpp>
int main() { boost::adjacency_list<> g; }


You can #include the header file with the has_rebind function before or after the type_traits header file, yielding two different compile errors:

This code below will result in the compile error '[C++ Error] is_abstract.hpp(117): E2316 'is_class' is not a member of 'boost''

  1. include <boost/mpl/aux_/has_rebind.hpp>
  2. include <boost/type_traits.hpp>
  3. include <boost/graph/adjacency_list.hpp>
int main() { boost::adjacency_list g; }


This code below will result in the compile error '[C++ Error] full_lambda.hpp(103): E2451 Undefined symbol 'quote1''

  1. include <boost/type_traits.hpp>
  2. include <boost/mpl/aux_/has_rebind.hpp>
  3. include <boost/graph/adjacency_list.hpp>
int main() { boost::adjacency_list<> g; }


(Turbo C++ 2006) [C++ Error] is_abstract.hpp(117): E2316 'is_class' is not a member of 'boost'

Happens in this code

  1. include <boost/mpl/aux_/has_rebind.hpp>
  2. include <boost/type_traits.hpp>
  3. include <boost/graph/adjacency_list.hpp>
int main() { boost::adjacency_list<> g; }


Changing the code to the code below, results in a new compile error 'full_lambda.hpp(103): E2451 Undefined symbol 'quote1''

  1. define BOOST_NO_IS_ABSTRACT
  2. include <boost/mpl/aux_/has_rebind.hpp>
  3. include <boost/type_traits.hpp>
  4. include <boost/graph/adjacency_list.hpp>
int main() { boost::adjacency_list<> g; }


(Turbo C++ 2006) [C++ Error] full_lambda.hpp(103): E2451 Undefined symbol 'quote1'



last edited (July 3, 2007) by bilderbikkel, Number of views: 3495, Current Rev: 9 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.