[Insight-users] migrating to Borland C++ builder 6

Dean Inglis dean . inglis at on . aibn . com
Fri, 9 May 2003 13:48:34 -0400


I have tried adding to CMAKE_CXX_FLAGS:STRING -D_USE_OLD_RW_STL
to force use of the old RogueWave Standard C++ Library.  this
resolves some initial vxl header issues but leads to

Building object file Templates\vnl_matrix+double-.obj...
Borland C++ 5.6 for Win32 Copyright (c) 1993, 2002 Borland
c:\Builder\Sources\Insight\Utilities\vxl\vnl\Templates\vnl_matrix+double-.cx
x:
Error E2478 C:\Program Files\Borland\CBuilder6\Include\oldstl\complex.h 787:
Too many template parameters were declared for template 'complex<float>'
Error E2478 C:\Program Files\Borland\CBuilder6\Include\oldstl\complex.h 799:
Too many template parameters were declared for template 'complex<double>'
Error E2478 C:\Program Files\Borland\CBuilder6\Include\oldstl\complex.h 812:
Too many template parameters were declared for template 'complex<long
double>'
*** 3 errors in Compile ***

According to BCB6 doc:


If a member declaration or definition occurs outside of a template class,
and that outer declaration
uses a different number of template parameters than the parent class, this
error will result. For
example:

template<class T, class U>

class foo {
		void method();
};

template<class T, class U, class V>
void foo<T, U, V>::method() { }	// error: too many parameters!

C++Builder 6 now includes the STLport multiplatform ANSI C++ Standard
Library implementation and uses this library by default. Though this
conversion may be
 seamless, you may notice some changes in the way your code operates. The
STLport implementation differs somewhat from the RogueWave Standard C++
Library
previously used as the default.
STLport uses the STD namespace for the library. However, internally
C++Builder refers to this namespace as _STL. You should only use the STD
namespace
(although if you have linker problems, you may see notice references to
_STD). If using template functions, such as swap, you will need to use the
_STL_STD
macro (defined in the STLport header file) for scope resolution.

The RogueWave Standard C++ Library is still included with C++Builder 6. If
you need to build using the RogueWave library, you must define the macro
 _USE_OLD_RW_STL, either at the command line (with the -D compiler option)
or on the Directories and Conditionals page of the Project Options dialog
box.
 It is recommended that you use the STLport library if possible.

thanks to JB for the conditional hint.

Dean