c++boost.gif (8819 bytes)Boost.MultiIndex Compiler specifics



Boost.MultiIndex has been tried in different compilers, with various degrees of success. We list the limitations encountered, along with suitable workarounds when available. Up to date information on compatibility of Boost.MultiIndex with several compilers can be found at the Boost Compiler Status Summary.

Contents

Borland C++ Builder 6.4

Currently, Boost.MultiIndex cannot be used with BCB 6.4. The number of problems encountered during the tests makes it unlikely that future versions of the library can be made to work under this compiler.

GNU GCC 3.3.1 (cygming special)

No problems have been detected with this compiler. The tests were performed under Cygwin 1.5.7. Most likely Boost.MultiIndex will work seamlessly for GNU GCC 3.3 or later under any platform.

Intel C++ Compiler for Windows 32-bit 7.0/7.1

member not supported, replace with member_offset or use the cross-platform macro BOOST_MULTI_INDEX_MEMBER.


Altough Koenig lookup seems to be officially supported by this compiler, some issues have arisen seemingly due to bugs related to this facility. In these cases you might need to explicitly qualify global names with ::boost::multi_index.

Intel C++ Compiler for Windows 32-bit 8.0

No problems have been detected with this compiler.

Metrowerks CodeWarrior 9.2 for Mac OS

No problems have been detected with this compiler.

Microsoft Visual C++ 6.0 Service Pack 5

member not supported, replace with member_offset or use the cross-platform macro BOOST_MULTI_INDEX_MEMBER.

const_mem_fun not supported, replace with const_mem_fun_explicit or use the cross-platform macro BOOST_MULTI_INDEX_CONST_MEM_FUN.

mem_fun is not supported, replace with mem_fun_explicit or use the cross-platform macro BOOST_MULTI_INDEX_MEM_FUN.


No support for index retrieval and projection nested types and member functions:

You can use instead their global equivalents. Also, this compiler does not implement Koenig lookup, so you might need to explicitly qualify these global names with ::boost::multi_index.


The lack of partial template specialization support in MSVC++ 6.0 results in some inconveniences when using composite_key that can be remedied as explained in "composite_key in compilers without partial template specialization" on the advanced topics section.


MSVC++ 6.0 presents serious limitations for the maximum length of symbol names generated by the compiler, which might result in the linker error LNK1179: invalid or corrupt file: duplicate comdat comdat. To overcome this problem, you can restrict the maximum number of elements accepted by indexed_by, tag and composite_key by globally setting the values of the macros

This operation results in a modest reduction of the lengths of symbol names.


Under some circumstances, the compiler emits the error C2587: '_U' : illegal use of local variable as default parameter, inside the MSVC internal header <xlocnum>. This problem is a recurrent bug of the compiler, and has been reported in other unrelated libraries, like the Boost Graph Library, Boost.MultiArray, Boost.Regex, CGAL and MySQL++. The error is triggered, though not in a systematic manner, by the use of multi_index_container iterator constructor. Two workarounds exist: the first consists of avoiding this constructor and replacing code like:

multi_index_container<...> s(c.begin(),c.end());

with equivalent operations:

multi_index_container<...> s;
s.insert(c.begin(),c.end());

The second workaround has not been confirmed by the author, but it is given on the Internet in connection with this error appearing in other libraries. Replace line 84 of <xlocnum>

 #define _VIRTUAL	virtual

with the following:

 #define _VIRTUAL

Warning: it is not known whether this replacement can result in unexpected side effects in code implicitly using <xlocnum>.


In general, the extensive use of templates by Boost.MultiIndex puts this compiler under severe stress, so that several internal limitations may be reached. The following measures can help alleviate these problems:

Microsoft Visual C++ 6.0 Service Pack 5 + STLport 4.6.2

Boost.MultiIndex works for this configuration. The same limitations apply as in MSVC++ 6.0 with its original Dinkumware standard library.

Microsoft Visual C++ 7.1

Problems have been reported when compiling the library with the /Gm option (Enable Minimal Rebuild.) Seemingly, this is due to an internal defect of the compiler (see for instance this mention of a similar issue in the Boost Users mailing list.) If /Gm is turned off, Boost.MultiIndex compiles and runs without further problems.




Revised May 7th 2004

Copyright © 2003-2004 Joaquín M López Muñoz. Use, modification, and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)