Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 590688

Summary: media-gfx/blender-2.72b-r4 fails to build with GCC 6: error: 'max' was not declared in this scope
Product: Gentoo Linux Reporter: David Roman <davidroman96>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED NEEDINFO    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge info
build.log.bz2

Description David Roman 2016-08-07 12:01:11 UTC
When compiling blender it gives the next error

/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp: In member function 'void DirectDrawSurface::mipmap(Image*, uint, uint)':
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp:1105:20: error: 'max' was not declared in this scope
   w = max(1U, w / 2);
                    ^
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp: In member function 'void DirectDrawSurface::readBlockImage(Image*)':
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp:1226:39: error: 'min' was not declared in this scope
    for (uint y = 0; y < min(4U, h-4*by); y++)
                                       ^
In file included from /var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.h:61:0,
                 from /var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp:58:
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp: In function 'Color32 buildNormal(uint8, uint8)':
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/Common.h:38:38: error: 'max' was not declared in this scope
 #define clamp(x,a,b) min(max((x), (a)), (b))
                                      ^
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp:1243:12: note: in expansion of macro 'clamp'
  uint8 z = clamp(int(255.0f * (nz + 1) / 2.0f), 0, 255);
            ^~~~~
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/Common.h:38:44: error: 'min' was not declared in this scope
 #define clamp(x,a,b) min(max((x), (a)), (b))
                                            ^
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp:1243:12: note: in expansion of macro 'clamp'
  uint8 z = clamp(int(255.0f * (nz + 1) / 2.0f), 0, 255);
            ^~~~~
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp: In member function 'uint DirectDrawSurface::mipmapSize(uint) const':
/var/tmp/portage/media-gfx/blender-2.72b-r4/work/blender-2.72b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp:1382:20: error: 'max' was not declared in this scope
   w = max(1U, w / 2);
                    ^
Comment 1 Mike Gilbert gentoo-dev 2016-08-09 22:16:23 UTC
Provide emerge --info and attach a full build log.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2016-08-10 00:16:55 UTC
1. Please attach the entire build log to this bug report.
2. Please post your `emerge --info` output in a comment.
Comment 3 David Roman 2016-08-10 20:39:41 UTC
Created attachment 442982 [details]
emerge info
Comment 4 David Roman 2016-08-10 20:42:23 UTC
Created attachment 442984 [details]
build.log.bz2