OpenSCAP / scap-workbench

SCAP Scanner And Tailoring Graphical User Interface
https://www.open-scap.org/tools/scap-workbench
GNU General Public License v3.0
223 stars 65 forks source link

Failure to build scap-workbench on Ubuntu 22.04.1 #304

Closed ktofa closed 1 year ago

ktofa commented 1 year ago

Hello, I am struggling to build ( during the make stage) the scap-workbench package on Ubuntu 22.04.1. It seems I am getting a QT based error message.

I am using the latest release tarball.

Error message is displayed below:

kanirip@expjump:~/scap-workbench-1.2.1/build$ make

[  2%] Built target docs
[  4%] Automatic MOC for target scap-workbench
[  4%] Built target scap-workbench_autogen
Consolidate compiler generated dependencies of target scap-workbench
[  6%] Building CXX object CMakeFiles/scap-workbench.dir/src/MainWindow.cpp.o
/home/kanirip/scap-workbench-1.2.1/src/MainWindow.cpp: In member function ‘void MainWindow::openFile(const QString&, bool)’:
/home/kanirip/scap-workbench-1.2.1/src/MainWindow.cpp:412:28: error: loop variable ‘path’ creates a copy from type ‘const QString’ [-Werror=range-loop-construct]
  412 |         for (const QString path : mScanningSession->getOriginalClosure())
      |                            ^~~~
/home/kanirip/scap-workbench-1.2.1/src/MainWindow.cpp:412:28: note: use reference type to prevent copying
  412 |         for (const QString path : mScanningSession->getOriginalClosure())
      |                            ^~~~
      |                            &
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/scap-workbench.dir/build.make:202: CMakeFiles/scap-workbench.dir/src/MainWindow.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:86: CMakeFiles/scap-workbench.dir/all] Error 2
make: *** [Makefile:156: all] Error 2 

Can anyone assist with this ?

ggbecker commented 1 year ago

I believe you have to disable warnings being treated as errors. Some newer version of the Qt library probably has some new warning type and the old code might contain these warnings. The ideal solution is to update the code to fix the warning.

ktofa commented 1 year ago

Hi, Just to confirm that in line with @ggbecker suggestion, I had to remove the -Werror flag in the CMakefile file in order to disable warning being treated as errors. I hope this issue can be resolved in the future, especially if the Linux community wants to have a single Security platform in OpenSCAP.