evtest-qt icon indicating copy to clipboard operation
evtest-qt copied to clipboard

build error

Open johndoe71rus opened this issue 2 years ago • 4 comments

lubuntu 20.04.5 LTS try to build, cmake witout errors

~/build/evtest-qt/evtest-qt/build$ cmake ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find tinycmmc (missing: tinycmmc_DIR)
-- tinycmmc module path: /home/johndoe/build/evtest-qt/evtest-qt/external/tinycmmc/modules/
-- Project Name: evtest-qt
-- Project Version: -128-NOTFOUND
-- WERROR disabled
-- WARNINGS disabled
CMake Warning at CMakeLists.txt:22 (find_package):
  By not providing "FindQt6.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt6", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt6" with any of
  the following names:

    Qt6Config.cmake
    qt6-config.cmake

  Add the installation prefix of "Qt6" to CMAKE_PREFIX_PATH or set "Qt6_DIR"
  to a directory containing one of the above files.  If "Qt6" provides a
  separate development package or SDK, be sure it has been installed.


-- Using Qt version: Qt5
-- Configuring done
-- Generating done
-- Build files have been written to: /home/johndoe/build/evtest-qt/evtest-qt/build

but error

~/build/evtest-qt/evtest-qt/build$ make                                                                                                                       
Scanning dependencies of target evtest-qt_autogen                                                                                                                                
[  4%] Automatic MOC and UIC for target evtest-qt                                                                                                                                
[  4%] Built target evtest-qt_autogen                                                                                                                                            
Scanning dependencies of target evtest-qt                                                                                                                                        
[  8%] Building CXX object CMakeFiles/evtest-qt.dir/evtest-qt_autogen/mocs_compilation.cpp.o                                                                                     
In file included from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/UVLADIE3JM/moc_evtest_app.cpp:9,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/mocs_compilation.cpp:2:
/home/johndoe/build/evtest-qt/evtest-qt/src/evtest_app.hpp:74:11: error: field ‘m_action_exit’ has incomplete type ‘QAction’
   74 |   QAction m_action_exit;
      |           ^~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QApplication:1,
                 from /home/johndoe/build/evtest-qt/evtest-qt/src/evtest_app.hpp:20,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/UVLADIE3JM/moc_evtest_app.cpp:9,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/mocs_compilation.cpp:2:
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qapplication.h:225:18: note: forward declaration of ‘class QAction’
  225 |     friend class QAction;
      |                  ^~~~~~~
In file included from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/UVLADIE3JM/moc_evtest_app.cpp:9,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/mocs_compilation.cpp:2:
/home/johndoe/build/evtest-qt/evtest-qt/src/evtest_app.hpp:75:11: error: field ‘m_action_show_about’ has incomplete type ‘QAction’
   75 |   QAction m_action_show_about;
      |           ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QApplication:1,
                 from /home/johndoe/build/evtest-qt/evtest-qt/src/evtest_app.hpp:20,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/UVLADIE3JM/moc_evtest_app.cpp:9,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/mocs_compilation.cpp:2:
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qapplication.h:225:18: note: forward declaration of ‘class QAction’
  225 |     friend class QAction;
      |                  ^~~~~~~
In file included from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/UVLADIE3JM/moc_evtest_app.cpp:9,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/mocs_compilation.cpp:2:
/home/johndoe/build/evtest-qt/evtest-qt/src/evtest_app.hpp:76:11: error: field ‘m_action_verification_mode’ has incomplete type ‘QAction’
   76 |   QAction m_action_verification_mode;
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QApplication:1,
                 from /home/johndoe/build/evtest-qt/evtest-qt/src/evtest_app.hpp:20,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/UVLADIE3JM/moc_evtest_app.cpp:9,
                 from /home/johndoe/build/evtest-qt/evtest-qt/build/evtest-qt_autogen/mocs_compilation.cpp:2:
/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qapplication.h:225:18: note: forward declaration of ‘class QAction’
  225 |     friend class QAction;
      |                  ^~~~~~~
make[2]: *** [CMakeFiles/evtest-qt.dir/build.make:63: CMakeFiles/evtest-qt.dir/evtest-qt_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/evtest-qt.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

johndoe71rus avatar Sep 19 '22 17:09 johndoe71rus

Make sure that you have dev libs: sudo apt-get install qtbase5-dev qtdeclarative5-dev And add 1 line or apply this diff:

diff --git a/src/evtest_app.hpp b/src/evtest_app.hpp
index 4032f4a..64c4439 100644
--- a/src/evtest_app.hpp
+++ b/src/evtest_app.hpp
@@ -17,6 +17,7 @@
 #ifndef HEADER_EVTEST_QT_EVTEST_APP_HPP
 #define HEADER_EVTEST_QT_EVTEST_APP_HPP
 
+#include <QAction>
 #include <QApplication>
 #include <QComboBox>
 #include <QGridLayout>

q4a avatar Nov 08 '22 12:11 q4a

Thanks q4a that worked

Pitriss avatar Apr 29 '23 19:04 Pitriss

Just hopping onto that generic issue.

I was able to build the current master by using nix build but when running the application I am getting

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb.

The Qt6 dependencies are loaded from /nix/store and my system seems to have the appropriate xcb libs installed (like libxcb-cursor0/xinerama0)

lostiniceland avatar Nov 16 '23 07:11 lostiniceland

After some more reading I was able to start it. As it turns out, after building via nix build I had to open a nix-shell via nix-shell evtest-qt and within that shell I was able to start ./result/bin/evtest-qt

lostiniceland avatar Nov 16 '23 08:11 lostiniceland