Message: Qt5 Error in Examples Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Qt5 Error in Examples 

Forum: Documentation and Examples
Date: 31 Jul, 2014
From: Joshua Ellis <Joshua Ellis>

Hi,

I recently installed Geant4 10.0.2 on Arch Linux, it has a very handy package manager allowing for the automatic installation of Geant4. You can see the build process here.

My system has both Qt4 and Qt5 installed, and the installation found Qt5; however, when I tried compiling the examples, it failed to find the Qt5 libraries. As a note, I am using cmake 3.0.0 and as part of the change from v2, policy CMP0028 changed. In Geant4LibraryDepends-release.cmake, there was:

set_target_properties(G4interfaces PROPERTIES
  IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "G4global;G4intercoms;Qt5::Widgets;Qt5::Gui;Qt5::Core;Qt5::PrintSupport;/usr/lib64/libXm.so;/usr/lib64/libSM.so;/usr/lib64/libICE.so;/usr/lib64/libX11.so;/usr/lib64/libXext.so"
  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libG4interfaces.so"
  IMPORTED_SONAME_RELEASE "libG4interfaces.so"
  )

Which caused the following error when running make

Linking CXX executable Ultra
/usr/bin/ld: cannot find -lQt5::Core
/usr/bin/ld: cannot find -lQt5::OpenGL
/usr/bin/ld: cannot find -lQt5::Gui
/usr/bin/ld: cannot find -lQt5::PrintSupport
/usr/bin/ld: cannot find -lQt5::Widgets
collect2: error: ld returned 1 exit status

I have then replaced all instances of Qt5:: to Qt5 in Geant4LibraryDepends-release.cmake so that I now have:

set_target_properties(G4interfaces PROPERTIES
  IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "G4global;G4intercoms;Qt5Widgets;Qt5Gui;Qt5Core;Qt5PrintSupport;/usr/lib64/libXm.so;/usr/lib64/libSM.so;/usr/lib64/libICE.so;/usr/lib64/libX11.so;/usr/lib64/libXext.so"
  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libG4interfaces.so"
  IMPORTED_SONAME_RELEASE "libG4interfaces.so"
  )

and running make on the examples no longer produces the error, but still fails to find certain Qt:

In file included from /usr/share/Geant4-10.0.2/examples/advanced/ChargeExchangeMC/ChargeExchangeMC.cc:61:0:
/usr/include/Geant4/G4UIQt.hh:39:21: fatal error: qobject.h: No such file or directory
 #include <qobject.h>
                     ^
compilation terminated.

If this is an actual bug, then I am happy to file a bug report. On the other hand, if this is a mistake on my part, please let me know what I need to change. Please let me know if you want any other information regarding my installation.

Thanks!

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Note: Re: Qt5 Error in Examples   (Garnier Laurent - 15 Oct, 2014)
 Add Message Add Message
to: "Qt5 Error in Examples"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]