FreeImage icon indicating copy to clipboard operation
FreeImage copied to clipboard

Fix MSVC C++ 20 compiler issue

Open elvisdukaj opened this issue 11 months ago • 3 comments

HI! It seems that the build is broken with the latest visual c++ compiler when enabling C++20.

What is the error log

C:\Users\edukaj\.conan2\p\b\freei373179c09645a\b\src\Source\MapIntrospector.h(98,36): error C2065: '_Node': undeclared identifier [C:\Users\edukaj\
.conan2\p\b\freei373179c09645a\b\build\FreeImage.vcxproj]
  ConversionRGBF.cpp
  (compiling source file '../src/Source/FreeImage/BitmapAccess.cpp')
  C:\Users\edukaj\.conan2\p\b\freei373179c09645a\b\src\Source\MapIntrospector.h(98,36):
  the template instantiation context (the oldest one first) is
        C:\Users\edukaj\.conan2\p\b\freei373179c09645a\b\src\Source\MapIntrospector.h(95,7):
        while compiling class template 'MapIntrospector'

C:\Users\edukaj\.conan2\p\b\freei373179c09645a\b\src\Source\MapIntrospector.h(98,36): error C3861: '_Node': identifier not found [C:\Users\edukaj\.
conan2\p\b\freei373179c09645a\b\build\FreeImage.vcxproj]
  (compiling source file '../src/Source/FreeImage/BitmapAccess.cpp')

What is my setup:

[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows

How can I reproduce it?

Simply use Visual C++ with C++20 enabled and start the build.

What is wrong?

FreeImage needs to understand the footprint of the map to understand the size of a bitmap. In the following line of code MapIntrospector derives from std::map but the field _Node seems not anymore exposed when building with C++20,

elvisdukaj avatar Mar 04 '24 12:03 elvisdukaj

There now is #8 demonstrating the necessity of this fix.

tbeu avatar Mar 20 '24 20:03 tbeu

Note, that also #9 is required for a successful CI build with tests on MSVC C++20.

tbeu avatar Mar 20 '24 21:03 tbeu

Any plan on when these PR will get merged?

elvisdukaj avatar Apr 18 '24 20:04 elvisdukaj