Compiler refusing to compile source file with duplicate template instantiations.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I know the VC 7.1 compiler has been made more standards compliant, but I have some code that compiled with VC 7.0 and now no longer compiles. The Error is

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xutility(341): error C2084: function 'std::_Scalar_ptr_iterator_tag std::_Ptr_cat(const std::_Bool *,std::_Bool *)' already has a bod
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xutility(251) : see previous definition of '_Ptr_cat

As far as I can tell by looking at the pre-processor output it seems that <xutility> is managing to be included twice??? i.e. the definition of the above function (and a couple of others) is being included twice in source actually passed to the compiler. As always this is code I have inherited...

Can anyone give me some ideas how I can get this stuff to build

Regards

Naeem.
 
Hi,

I know the VC 7.1 compiler has been made more standards compliant, but I have some code that compiled with VC 7.0 and now no longer compiles. The Error is:

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xutility(341): error C2084: function 'std::_Scalar_ptr_iterator_tag std::_Ptr_cat(const std::_Bool *,std::_Bool *)' already has a body
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xutility(251) : see previous definition of '_Ptr_cat'

As far as I can tell by looking at the pre-processor output it seems that <xutility> is managing to be included twice???

i.e. the definition of the above function (and a couple of others) is being included twice in source actually passed to the compiler. As always this is code I have inherited....

Lets see the code - give us a short example that produces the error.
In cutting it down you'll probably find the problem anyway.
Can anyone give me some ideas how I can get this stuff to build.

Without knowing what "this stuff" is it's quite hard to offer any
specific advice...

Tom
 
Back
Top