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

Bug 585378

Summary: x11-misc/lightdm-1.19.0[qt5]: error: #error "Qt requires C++11 support"
Product: Gentoo Linux Reporter: James Dominy <jgdominy>
Component: Current packagesAssignee: Markos Chandras (RETIRED) <hwoarang>
Status: RESOLVED FIXED    
Severity: normal CC: endymion+gentoo, fischer, kensington, mail, rose, walch.martin
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 589412    
Attachments: emerge.info
build log
Set compiler flag to enable C++-11
Enable C++-11

Description James Dominy 2016-06-08 13:18:28 UTC
x11-misc/lightdm-1.19.0 compile failure due to missing C++11 support in qt5
Comment 1 James Dominy 2016-06-08 13:19:54 UTC
Created attachment 436868 [details]
emerge.info
Comment 2 James Dominy 2016-06-08 13:21:04 UTC
Created attachment 436870 [details]
build log
Comment 3 James Dominy 2016-06-08 13:22:03 UTC
$ emerge -pqv lightdm
[ebuild     U ] x11-misc/lightdm-1.19.0 [1.16.6] USE="gtk introspection qt5 -audit -gnome -kde -qt4"
Comment 4 jospezial 2016-06-15 01:31:09 UTC
see also
https://bugs.gentoo.org/show_bug.cgi?id=566950#c12
Comment 5 jospezial 2016-06-24 19:59:09 UTC
still the same with x11-misc/lightdm-1.19.1
Comment 6 Thomas Fischer 2016-07-06 19:48:05 UTC
Qt starting from version 5.7 requires C++11 support from the C++ compiler [1]. This is usually no problem, one has to pass  -std=c11  as a compiler flag (CFLAGS or CXXFLAGS?).

I haven't tested it, but I strongly assume that using Qt 5.6 will work fine with lightdm.

[1] https://wiki.qt.io/New_Features_in_Qt_5.7
Comment 7 Thomas Fischer 2016-07-06 20:16:34 UTC
Created attachment 439920 [details, diff]
Set compiler flag to enable C++-11

This simple patch sets the compiler flag  -std=c++11  to enable C++-11 support for the compiler.
Seems to work for both the current stable version 1.16.7 as well as the latest unstable in Portage, 1.19.0.

Not covered:
- Test if compiler actually supports C++11, but all current C++ compilers should do it
- Not tested with any other compiler than GNU C++ 4.9.3

This patch should be submitted upstream if it can be confirmed to fix the problem for the bug reporter.
Comment 8 jospezial 2016-07-07 02:23:32 UTC
Patch works for x11-misc/lightdm-1.19.1 too. But I see this warning:

libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -pthread -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libxml2 -Wall -Wstrict-prototypes -Wnested-externs -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -I../common -DCONFIG_DIR=\"/etc/lightdm\" -DSESSIONS_DIR=\"/usr/share/lightdm/sessions:/usr/share/xsessions:/usr/share/wayland-sessions\" -DWAYLAND_SESSIONS_DIR=\"/usr/share/wayland-sessions\" -DREMOTE_SESSIONS_DIR=\"/usr/share/lightdm/remote-sessions\" -march=native -O2 -pipe -std=c++11 -c user.c  -fPIC -DPIC -o .libs/liblightdm_gobject_1_la-user.o
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C
Comment 9 Thomas Fischer 2016-07-24 21:04:11 UTC
Created attachment 441472 [details, diff]
Enable C++-11

(In reply to jospezial from comment #8)
> Patch works for x11-misc/lightdm-1.19.1 too. But I see this warning:
> [..]
> cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but
> not for C
> cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but
> not for C
This revised patch only sets CXXFLAGS. I cannot observe this warning on my system when using this revised patch.
Comment 10 Coacher 2016-09-04 08:51:10 UTC
*** Bug 592828 has been marked as a duplicate of this bug. ***
Comment 11 Michael Palimaka (kensington) gentoo-dev 2016-09-28 17:28:21 UTC
Thanks, fixed in git.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=982352bbef9975f795c521bea2f06bf2771ecf06