compile error 3.1.1 on rhel 7
lphabc opened this issue · comments
- Linux-distro (kernel version): 3.10.0-957.el7.x86_64
- Desktop Environment (KDE/GNOME etc.): Gnome
- Qt Version: Qt5
- KDiskMark Version: 3.1.1
- FIO Version: fio-3.1-2
Description: cpack -G RPM
tmp/kdisk/KDiskMark-3.1.1/src/mainwindow.cpp: In member function ‘virtual void MainWindow::changeEvent(QEvent*)’:
/tmp/kdisk/KDiskMark-3.1.1/src/mainwindow.cpp:216:58: error: expected ‘)’ before ‘:’ token
if (const QLocale locale = AppSettings().locale(): locale == AppSettings::defaultLocale())
^
/tmp/kdisk/KDiskMark-3.1.1/src/mainwindow.cpp:216:98: error: could not convert ‘locale’ from ‘const QLocale’ to ‘bool’
if (const QLocale locale = AppSettings().locale(): locale == AppSettings::defaultLocale())
^
gmake[2]: *** [CMakeFiles/kdiskmark.dir/src/mainwindow.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/kdiskmark.dir/all] Error 2
gmake: *** [all] Error 2
Steps To Reproduce: Follow your directions for building.
/tmp/kdisk/KDiskMark-3.1.1/src/mainwindow.cpp: In member function ‘virtual void MainWindow::changeEvent(QEvent*)’:
/tmp/kdisk/KDiskMark-3.1.1/src/mainwindow.cpp:216:58: error: expected ‘)’ before ‘;’ token
if (const QLocale locale = AppSettings().locale(); locale == AppSettings::defaultLocale())
^
/tmp/kdisk/KDiskMark-3.1.1/src/mainwindow.cpp:216:58: error: could not convert ‘locale’ from ‘const QLocale’ to ‘bool’
/tmp/kdisk/KDiskMark-3.1.1/src/mainwindow.cpp:216:97: error: invalid use of non-static member function
if (const QLocale locale = AppSettings().locale(); locale == AppSettings::defaultLocale())
^
gmake[2]: *** [CMakeFiles/kdiskmark.dir/src/mainwindow.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/kdiskmark.dir/all] Error 2
gmake: *** [all] Error 2
Copied and pasted wrong one sorry.
RHEL7 comes with GCC 4.8, which isn't supporting using syntax, you can rewrite it
case QEvent::LocaleChange: {
- if (const QLocale locale = AppSettings().locale(); locale == AppSettings::defaultLocale())
+ const QLocale locale = AppSettings().locale();
+ if (locale == AppSettings::defaultLocale())
AppSettings::applyLocale(locale);
break;
}
Thanks, that worked great. Now the only problem is I'm getting the following message:
Cannot launch daemon, file not found or permissions invalid
Thank You.
Saw the following in /var/log/messages
dbus[3219]: [system] Activated service 'dev.jonmagon.kdiskmark.helperinterface' failed: Cannot launch daemon, file not found or permissions invalid
Found it. kdiskmark_helper was in /usr/libexec where the /usr/share/dbus-1/system-services/dev.jonmagon,kdiskmark.helperinterfaces.service was pointing to /usr/local/libexec/kdiskmark_helper
I made a link for /usr/libexec/kdiskmark_helper to /usr/local/libexec/kdiskmark_helper
Found it. kdiskmark_helper was in /usr/libexec where the /usr/share/dbus-1/system-services/dev.jonmagon,kdiskmark.helperinterfaces.service was pointing to /usr/local/libexec/kdiskmark_helper
I made a link for /usr/libexec/kdiskmark_helper to /usr/local/libexec/kdiskmark_helper
Interesting. CMakeLists.txt has not been edited? It uses KDE_INSTALL_LIBEXECDIR for kdiskmark_helper
installing and dev.jonmagon.kdiskmark.helperinterfaces.service
configuring, should be the same.
No hasn't been changed and has DESTINATION ${KDE_INSTALL_LIBEXECDIR}