KDAB / hotspot

The Linux perf GUI for performance analysis.
4.06k stars 251 forks source link

undefined reference #382

Closed phungorquan closed 2 years ago

phungorquan commented 2 years ago

Describe the bug

I got this error when tried to make the hotspot: This is log:

[ 54%] Building CXX object src/CMakeFiles/hotspot.dir/costcontextmenu.cpp.o
[ 55%] Building CXX object src/CMakeFiles/hotspot.dir/hotspot_autogen/EWIEGA46WW/qrc_resources.cpp.o
[ 55%] Linking CXX executable ../bin/hotspot
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5.12.8: undefined reference to `QMetaCallEvent::QMetaCallEvent(unsigned short, unsigned short, void (*)(QObject*, QMetaObject::Call, int, void**), QObject const*, int, int, int*, void**, QSemaphore*)@Qt_5_PRIVATE_API'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/hotspot.dir/build.make:491: bin/hotspot] Error 1
make[1]: *** [CMakeFiles/Makefile2:1678: src/CMakeFiles/hotspot.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

To Reproduce Steps to reproduce the behavior:

  1. Go to build-hotspot folder
  2. cmake ../hotspot
  3. make
  4. See error

Expected behavior I think I could change the path in CMakeLists.txt but I don't know where they are. Ex: The first error is : libQt5DBus.so.5 it error in src/CMakeLists.txt but when I go to build-hotspot/src. I didn't see the file Can build hotspot successfully :(

Screenshots

xiu@twheel:~/build-hotspot$ cmake ../hotspot
-- Could NOT find Zstd (missing: Zstd_LIBRARY Zstd_INCLUDE_DIR) 
-- Could NOT find LibRustcDemangle (missing: LIBRUSTC_DEMANGLE_LIBRARIES) 
-- Could NOT find LibDDemangle (missing: LIBD_DEMANGLE_LIBRARIES) 
-- Could NOT find KF5Archive (missing: KF5Archive_DIR)
-- Could NOT find QCustomPlot (missing: QCustomPlot_LIBRARIES QCustomPlot_INCLUDE_DIRS) 
-- The following RUNTIME packages have been found:

 * objdump, Utility to generate disassembler, <https://www.gnu.org/software/binutils/>
   Support for annotating individual instructions

-- The following OPTIONAL packages have been found:

 * KF5Service (required version >= 5.68.0)
 * KF5Completion (required version >= 5.68.0)
 * KF5JobWidgets (required version >= 5.68.0)
 * KF5Sonnet (required version >= 5.68.0)
 * KF5Codecs (required version >= 5.68.0)
 * KF5WidgetsAddons (required version >= 5.68.0)
 * KF5XmlGui (required version >= 5.68.0)
 * KF5Auth

-- The following REQUIRED packages have been found:

 * Qt5Gui (required version >= 5.15.2)
 * Qt5Test
 * Qt5Svg
 * Qt5 (required version >= 5.15)
 * LibElf
 * ElfUtils
 * ECM (required version >= 1.0.0)
 * Threads
 * KF5ThreadWeaver
 * KF5ItemModels
 * KF5WindowSystem
 * KF5Notifications
 * KF5IconThemes
 * KF5ItemViews (required version >= 5.68.0)
 * KF5Solid (required version >= 5.68.0)
 * Qt5Network (required version >= 5.12.0)
 * Gettext
 * KF5ConfigWidgets (required version >= 5.68.0)
 * KF5Parts
 * KF5
 * Qt5Core (required version >= 5.12.0)
 * KF5CoreAddons (required version >= 5.68.0)
 * Qt5Widgets
 * KDDockWidgets
   KDDockWidgets is a Qt dock widget library written by KDAB, suitable for replacing QDockWidget and implementing
 advanced functionalities missing in Qt. https://github.com/KDAB/KDDockWidgets

-- The following RUNTIME packages have not been found:

 * LibRustcDemangle, Demangling for Rust symbols, written in Rust., <https://github.com/alexcrichton/rustc-demangle>
   Demangling of Rust symbols
 * LibDDemangle, Demangling for D symbols, written in D., <https://github.com/lievenhey/d_demangler>
   Demangling of D symbols

-- The following OPTIONAL packages have not been found:

 * Zstd
 * KF5Archive
 * QCustomPlot
   QCustomPlot is a Qt charting library. https://www.qcustomplot.com/

Installing in /usr/local. Run /home/xiu/build-hotspot/prefix.sh to set the environment for hotspot.
-- Configuring done
CMake Warning at src/CMakeLists.txt:137 (add_executable):
  Cannot generate a safe runtime search path for target hotspot-auth-helper
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libQt5DBus.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib

  Some of these libraries may not be found correctly.

CMake Warning at src/CMakeLists.txt:90 (add_executable):
  Cannot generate a safe runtime search path for target hotspot because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libQt5Concurrent.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5Xml.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5DBus.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib

  Some of these libraries may not be found correctly.

CMake Warning at /usr/share/ECM/modules/ECMAddTests.cmake:110 (add_executable):
  Cannot generate a safe runtime search path for target tst_disassemblyoutput
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libQt5Xml.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5DBus.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  tests/modeltests/CMakeLists.txt:25 (ecm_add_test)

CMake Warning at /usr/share/ECM/modules/ECMAddTests.cmake:110 (add_executable):
  Cannot generate a safe runtime search path for target tst_timelinedelegate
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libQt5Xml.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5DBus.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  tests/modeltests/CMakeLists.txt:14 (ecm_add_test)

CMake Warning at /usr/share/ECM/modules/ECMAddTests.cmake:110 (add_executable):
  Cannot generate a safe runtime search path for target tst_models because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libQt5Xml.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5DBus.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  tests/modeltests/CMakeLists.txt:3 (ecm_add_test)

CMake Warning at tests/integrationtests/CMakeLists.txt:37 (add_executable):
  Cannot generate a safe runtime search path for target dump_perf_data
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libQt5Concurrent.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5Xml.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5DBus.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib

  Some of these libraries may not be found correctly.

CMake Warning at /usr/share/ECM/modules/ECMAddTests.cmake:110 (add_executable):
  Cannot generate a safe runtime search path for target tst_perfparser
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libQt5Concurrent.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5Xml.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib
    runtime library [libQt5DBus.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  tests/integrationtests/CMakeLists.txt:5 (ecm_add_test)

CMake Warning at /usr/share/ECM/modules/ECMAddTests.cmake:110 (add_executable):
  Cannot generate a safe dependent library path for target tst_perfparser
  because files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libQt5Xml.so.5] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/xiu/Qt/5.15.2/gcc_64/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  tests/integrationtests/CMakeLists.txt:5 (ecm_add_test)

-- Generating done
-- Build files have been written to: /home/xiu/build-hotspot
xiu@twheel:~/build-hotspot$ sudo apt remove libkf5archive-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'libkf5archive-dev' is not installed, so not removed
The following package was automatically installed and is no longer required:
  libkf5archive-doc
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 117 not upgraded.
xiu@twheel:~/build-hotspot$ make
[  0%] Automatic MOC and UIC for target tst_perfdata
[  0%] Built target tst_perfdata_autogen
[ 10%] Built target tst_perfdata
[ 10%] Automatic MOC and UIC for target tst_elfmap
[ 10%] Built target tst_elfmap_autogen
[ 12%] Built target tst_elfmap
[ 12%] Automatic MOC and UIC for target tst_addresscache
[ 12%] Built target tst_addresscache_autogen
[ 16%] Built target tst_addresscache
[ 16%] Automatic MOC and UIC for target perf2text
[ 16%] Built target perf2text_autogen
[ 18%] Built target perf2text
[ 18%] Built target link_perfparser
[ 18%] Automatic MOC and UIC for target PrefixTickLabels
[ 18%] Built target PrefixTickLabels_autogen
[ 19%] Built target PrefixTickLabels
[ 19%] Automatic MOC and UIC for target hotspot-perfparser
[ 19%] Built target hotspot-perfparser_autogen
[ 28%] Built target hotspot-perfparser
[ 29%] actions for com.kdab.hotspot.perf
[ 29%] Built target com.kdab.hotspot.perf.policy-customtarget
[ 29%] Automatic MOC and UIC for target hotspot-auth-helper
[ 29%] Built target hotspot-auth-helper_autogen
[ 31%] Built target hotspot-auth-helper
[ 31%] Automatic MOC and UIC for target models
[ 31%] Built target models_autogen
Scanning dependencies of target models
[ 32%] Building CXX object src/models/CMakeFiles/models.dir/__/util.cpp.o
[ 33%] Linking CXX static library libmodels.a
[ 41%] Built target models
[ 42%] Automatic MOC and UIC for target hotspot
[ 42%] Built target hotspot_autogen
Scanning dependencies of target hotspot
[ 42%] Building CXX object src/CMakeFiles/hotspot.dir/hotspot_autogen/mocs_compilation.cpp.o
[ 43%] Building CXX object src/CMakeFiles/hotspot.dir/main.cpp.o
[ 43%] Building CXX object src/CMakeFiles/hotspot.dir/parsers/perf/perfparser.cpp.o
[ 44%] Building CXX object src/CMakeFiles/hotspot.dir/perfrecord.cpp.o
[ 44%] Building CXX object src/CMakeFiles/hotspot.dir/mainwindow.cpp.o
[ 45%] Building CXX object src/CMakeFiles/hotspot.dir/flamegraph.cpp.o
[ 45%] Building CXX object src/CMakeFiles/hotspot.dir/aboutdialog.cpp.o
[ 46%] Building CXX object src/CMakeFiles/hotspot.dir/startpage.cpp.o
[ 46%] Building CXX object src/CMakeFiles/hotspot.dir/recordpage.cpp.o
[ 47%] Building CXX object src/CMakeFiles/hotspot.dir/resultspage.cpp.o
[ 47%] Building CXX object src/CMakeFiles/hotspot.dir/resultssummarypage.cpp.o
[ 48%] Building CXX object src/CMakeFiles/hotspot.dir/resultstopdownpage.cpp.o
[ 48%] Building CXX object src/CMakeFiles/hotspot.dir/resultsbottomuppage.cpp.o
[ 49%] Building CXX object src/CMakeFiles/hotspot.dir/resultsflamegraphpage.cpp.o
[ 49%] Building CXX object src/CMakeFiles/hotspot.dir/resultscallercalleepage.cpp.o
[ 50%] Building CXX object src/CMakeFiles/hotspot.dir/resultsdisassemblypage.cpp.o
[ 50%] Building CXX object src/CMakeFiles/hotspot.dir/resultsutil.cpp.o
[ 51%] Building CXX object src/CMakeFiles/hotspot.dir/costheaderview.cpp.o
[ 51%] Building CXX object src/CMakeFiles/hotspot.dir/timelinewidget.cpp.o
[ 51%] Building CXX object src/CMakeFiles/hotspot.dir/dockwidgetsetup.cpp.o
[ 52%] Building CXX object src/CMakeFiles/hotspot.dir/settingsdialog.cpp.o
[ 52%] Building CXX object src/CMakeFiles/hotspot.dir/multiconfigwidget.cpp.o
[ 53%] Building CXX object src/CMakeFiles/hotspot.dir/perfoutputwidget.cpp.o
[ 53%] Building CXX object src/CMakeFiles/hotspot.dir/perfoutputwidgettext.cpp.o
[ 54%] Building CXX object src/CMakeFiles/hotspot.dir/perfoutputwidgetkonsole.cpp.o
[ 54%] Building CXX object src/CMakeFiles/hotspot.dir/costcontextmenu.cpp.o
[ 55%] Building CXX object src/CMakeFiles/hotspot.dir/hotspot_autogen/EWIEGA46WW/qrc_resources.cpp.o
[ 55%] Linking CXX executable ../bin/hotspot
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5.12.8: undefined reference to `QMetaCallEvent::QMetaCallEvent(unsigned short, unsigned short, void (*)(QObject*, QMetaObject::Call, int, void**), QObject const*, int, int, int*, void**, QSemaphore*)@Qt_5_PRIVATE_API'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/hotspot.dir/build.make:491: bin/hotspot] Error 1
make[1]: *** [CMakeFiles/Makefile2:1678: src/CMakeFiles/hotspot.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Version Info (please complete the following information):

Additional context Add any other context about the problem here.

milianw commented 2 years ago

This is a setup issue with your Qt, ask your distributor about it, it's totally unrelated to hotspot (we don't even use dbus directly)

phungorquan commented 2 years ago

I fixed this problem but have been conflicted between 2 Qt versions when run hotspot. So I want to leave the comment here for anyone get this issue as well.

Just back to the main hotspot folder. Then use grep to find out files are using old Qt version, As my log that is : 5.12.8 Just use: grep -r 5.12.8 Then go to those files and edit to your correct version.

But maybe you will be conflicted. ^^. Thank you!