Locked Re: Compiling for arm64 Issue

Dave Carlton

I had that same error on the MAC, I edited the file and commented out the duplicate.

On Apr 12, 2020, at 17:02, Bill Somerville <g4wjs@...> wrote:

On 12/04/2020 20:24, JT Croteau wrote:
Friends, I'm trying to compile 2.1.2 on Linux arm64 but having an
issue.  I'm wondering if anyone can help please?  arm64 is a different
platform than armhf so I can't use the binary package on my Gentoo
system.  Target hardware is a Raspberry Pi4B. Thanks

Failing here:

[ 69%] Building CXX object CMakeFiles/wsjt_qt.dir/qt_helpers.cpp.o
In file included from /home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.cpp:1:
/home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.hpp: In static
member function ‘static QVariant VPtr<T>::asQVariant(T*)’:
warning: ‘QVariant qVariantFromValue(const T&) [with T = void*]’ is
deprecated: Use QVariant::fromValue() instead.
   77 |     return qVariantFromValue (reinterpret_cast<void *> (ptr));
      |                                                             ^
In file included from /usr/include/qt5/QtCore/qlocale.h:43,
                 from /usr/include/qt5/QtCore/qtextstream.h:46,
                 from /usr/include/qt5/QtCore/qdebug.h:49,
                 from /usr/include/qt5/QtNetwork/qabstractsocket.h:47,
                 from /usr/include/qt5/QtNetwork/qhostaddress.h:48,
                 from /usr/include/qt5/QtNetwork/QHostAddress:1,
                 from /home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.hpp:9,
                 from /home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.cpp:1:
/usr/include/qt5/QtCore/qvariant.h:528:17: note: declared here
  528 | inline QVariant qVariantFromValue(const T &t)
      |                 ^~~~~~~~~~~~~~~~~
In file included from /home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.cpp:1:
/home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.hpp: At global scope:
/home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.hpp:87:10: error:
redefinition of ‘struct std::hash<QString>’
   87 |   struct hash<QString>
      |          ^~~~~~~~~~~~~
In file included from /usr/include/qt5/QtCore/qlist.h:47,
                 from /usr/include/qt5/QtCore/qhash.h:46,
                 from /usr/include/qt5/QtCore/qshareddata.h:46,
                 from /usr/include/qt5/QtNetwork/qhostaddress.h:47,
                 from /usr/include/qt5/QtNetwork/QHostAddress:1,
                 from /home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.hpp:9,
                 from /home/n1ese/build/wsjtx-prefix/src/wsjtx/qt_helpers.cpp:1:
/usr/include/qt5/QtCore/qhashfunctions.h:204:1: note: previous
definition of ‘struct std::hash<QString>’
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[5]: *** [CMakeFiles/wsjt_qt.dir/build.make:106:
CMakeFiles/wsjt_qt.dir/qt_helpers.cpp.o] Error 1
gmake[5]: Leaving directory '/home/n1ese/build/wsjtx-prefix/src/wsjtx-build'
gmake[4]: *** [CMakeFiles/Makefile2:822: CMakeFiles/wsjt_qt.dir/all] Error 2
gmake[4]: Leaving directory '/home/n1ese/build/wsjtx-prefix/src/wsjtx-build'
gmake[3]: *** [Makefile:169: all] Error 2
gmake[3]: Leaving directory '/home/n1ese/build/wsjtx-prefix/src/wsjtx-build'
gmake[2]: *** [CMakeFiles/wsjtx-build.dir/build.make:78:
wsjtx-prefix/src/wsjtx-stamp/wsjtx-build] Error 2
gmake[2]: Leaving directory '/home/n1ese/build'
gmake[1]: *** [CMakeFiles/Makefile2:405: CMakeFiles/wsjtx-build.dir/all] Error 2
gmake[1]: Leaving directory '/home/n1ese/build'
gmake: *** [Makefile:101: all] Error 2

Hi JT (?),

the following patch should get you going.


commit f769f179c816a244f91dba359ad9e0a3eb234e0a
Author: Bill Somerville <bill@...>
Date:   Sat Feb 1 23:55:18 2020 +0000

    Remove std::hash<QString> specialization for Qt >= 5.14

diff --git a/qt_helpers.hpp b/qt_helpers.hpp
index b2ec7a49f..cf86f585b 100644
--- a/qt_helpers.hpp
+++ b/qt_helpers.hpp
@@ -78,6 +78,12 @@ public:

+// The Qt  devs "fixed" this  in 5.14 to  specialize to use  their own
+// qHash(), it doesn't  fix the problem we were  addressing as qHash()
+// returns a  uint so is  still a  poorly distributed 32-bit  value on
+// 64-bit platforms, but  we can't specialize ourselves  as Qt already
+// has - sigh.
 namespace std
   // std::hash<> specialization for QString based on the dbj2
@@ -97,6 +103,7 @@ namespace std

 // Register some useful Qt types with QMetaType

Join {main@WSJTX.groups.io to automatically receive all group messages.