[Development] Error building Qt 5 with clang in 32-bit

Olivier Goffart olivier at woboq.com
Wed Aug 15 17:30:51 CEST 2012


On Wednesday 15 August 2012 11:20:16 Stephen Chu wrote:
> I tried to build Qt 5 (from git) with MacPorts clang 4.7 using
> macx-clang-libc++-32 mkspec. It failed with narrowing errors like this:
> 
> styles/qmacstyle_mac.mm:3828:45: error: non-constant-expression cannot
> be narrowed from type 'qreal'
>        (aka 'double') to 'CGFloat' (aka 'float') in initializer list
> [-Wc++11-narrowing]
>                      CGFloat colorComp[] = { textColor.redF(),
> textColor.greenF(),
>                                              ^~~~~~~~~~~~~~~~
> 
> Building in 64-bit works since CGFloat is defined as double in x64, but
> it's float in 32-bit.
>
> Anyway I can work around this?

CGFloat colorComp[] = { static_cast<CGFloat>(textColor.redF()),
static_cast<CGFloat>(textColor.greenF()),

-- 
Olivier

Woboq - Qt services and support - http://woboq.com



More information about the Development mailing list