Many versions of MSVC all produce errors

Issue #443 wontfix
theoractice created an issue

Hello,

I created a new project with only one empty main() function in Visual Studio, and only added one #include line:

#include <blaze/Blaze.h>

then I get a lot of errors.

1>d:\coding\vcpkg\installed\x86-windows\include\blaze\util\limits.h(316): error C2766: explicit specialization; 'blaze::Limits<unsigned int>' has already been defined
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\util\limits.h(239): note: see previous definition of 'Limits<unsigned int>'
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\util\limits.h(338): error C2766: explicit specialization; 'blaze::Limits<int>' has already been defined
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\util\limits.h(255): note: see previous definition of 'Limits<int>'
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(122): error C2535: 'blaze::NegativeInfinity<I>::operator int(void) const': member function already defined or declared
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(119): note: see declaration of 'blaze::NegativeInfinity<I>::operator int'
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(152): note: see reference to class template instantiation 'blaze::NegativeInfinity<I>' being compiled
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(269): error C2995: 'blaze::NegativeInfinity<I>::operator int(void) const': function template has already been defined
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(119): note: see declaration of 'blaze::NegativeInfinity<I>::operator int'
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(564): error C2535: 'blaze::Infinity::operator unsigned int(void) const': member function already defined or declared
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(559): note: see declaration of 'blaze::Infinity::operator unsigned int'
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(565): error C2535: 'blaze::Infinity::operator int(void) const': member function already defined or declared
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(560): note: see declaration of 'blaze::Infinity::operator int'
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(751): error C2084: function 'blaze::Infinity::operator unsigned int(void) const' already has a body
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(701): note: see previous definition of 'operator unsigned int'
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(750): error C3615: constexpr function 'blaze::Infinity::operator unsigned int' cannot result in a constant expression
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(753): note: failure was caused by control reaching the end of a constexpr function
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(765): error C2084: function 'blaze::Infinity::operator int(void) const' already has a body
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(713): note: see previous definition of 'operator int'
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(764): error C3615: constexpr function 'blaze::Infinity::operator int' cannot result in a constant expression
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\infinity.h(767): note: failure was caused by control reaching the end of a constexpr function
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\traits\bandtrait.h(72): error C2264: 'blaze::Infinity::operator int': error in function definition or declaration; function not called
1>d:\coding\vcpkg\installed\x86-windows\include\blaze\math\traits\bandtrait.h(72): fatal error C1903: unable to recover from previous error(s); stopping compilation

Using Microsoft Visual Studio 2022/2019/2017. The blaze library (version 3.8.1) is installed via vcpkg.

Comments (3)

  1. Klaus Iglberger

    Hi!

    The problem occurs only in case you try to compile in 32bit mode. This mode is not supported in Blaze. Please try to compile in 64bit mode.

    Best regards, Klaus!

  2. Log in to comment