boost::function and VC6 compile failure
Hi,
I am using the function classes in VC6 and have hit a problem
The problem is that the compiler can't allocate enough space to build
(The error mesages are at the bottom)
Nomally you use the /ZmXXX compiler flag to make this bigger
but that doesn't work in this case
Has anyone hit this before?
Is there a simple workaround?
In case it makes a differnce the problem arises as follows
I have a template class which has instances of boost::function1 and 2
If I build with only one version of my class everything is fine
when I have more versions (I need about 12 different types) it stops
Vin
boost_1_30_0\boost\type_traits\has_trivial_copy.hpp(31): fatal error
C1204: compiler limit : internal structure overflow
boost_1_30_0\boost\type_traits\has_trivial_copy.hpp(43): see
reference to class template instantiation
'boost::detail::has_trivial_copy_impl
Vincent Finn wrote:
Hi,
Hi Vincent,
I am using the function classes in VC6 and have hit a problem
The problem is that the compiler can't allocate enough space to build (The error mesages are at the bottom) Nomally you use the /ZmXXX compiler flag to make this bigger but that doesn't work in this case
Has anyone hit this before?
Yes, this is a know issue. Basically, the error is triggered by a large amount of [class] template specializations within a single translation unit. Unfortunatety, while trying to support certain functionalily on broken compilers, some boost headers contribute a fair amount of those on their own (please see below). In combination with your own heavy templated code, this can lead to the errors you've seen.
Is there a simple workaround?
The simplest one is to split a single translation unit into several ones, if it's possible. If it's not, or of this still doesn't help, and you are sure that you are _not_ using the type_traits type transformation templates (http://www.boost.org/libs/type_traits/index.htm#transformations), then you can define (a project wise) BOOST_TT_NO_BROKEN_COMPILER_SPEC macro and see how this one works out. Note that for the latter you'll need the latest CVS version of type_traits library, and that some of the other boost libraries might rely on things like 'remove_pointer' working properly, so depending on that this might or might not be a viable option. HTH, Aleksey
Aleksey Gurtovoy wrote:
Vincent Finn wrote:
I am using the function classes in VC6 and have hit a problem
The problem is that the compiler can't allocate enough space to build (The error mesages are at the bottom) Nomally you use the /ZmXXX compiler flag to make this bigger but that doesn't work in this case
Is there a simple workaround?
The simplest one is to split a single translation unit into several ones, if it's possible.
Unfortunately I can't do that
If it's not, or of this still doesn't help, and you are sure that you are _not_ using the type_traits type transformation templates (http://www.boost.org/libs/type_traits/index.htm#transformations), then you can define (a project wise) BOOST_TT_NO_BROKEN_COMPILER_SPEC macro and see how this one works out.
Note that for the latter you'll need the latest CVS version of type_traits library, and that some of the other boost libraries might rely on things like 'remove_pointer' working properly, so depending on that this might or might not be a viable option.
I tried to use CVS and couldn't get it to connect (never used it before) Since there is no gaurantee that the problem will be fixed I can't be bothered spending anymore time playing with TortoiseCVS to get it working so I have abandoned boost::function and gone back to function pointers Oh well :-( Thanks anyway, Vin
participants (2)
-
Aleksey Gurtovoy
-
Vincent Finn