support Linux build with qt6-base-dev & qt6-multimedia-dev

There was an error:
    ../win/Qt/qt_main.cpp:767:37: error: attempt to use a deleted function
                        action->setData(actchar);
                                        ^
    /usr/include/x86_64-linux-gnu/qt6/QtCore/qvariant.h:199:5: note: 'QVariant<char *, false>' has been explicitly marked deleted here
        QVariant(T) = delete;
        ^
    1 error generated.

I'm hoping the fix applied is the correct one for the error.
This commit is contained in:
nhmall
2023-08-08 12:41:44 -04:00
parent 491cc9933f
commit b7c92b498d
3 changed files with 83 additions and 65 deletions
+70 -62
View File
@@ -83,68 +83,76 @@ Note that curses, X11, and Qt will almost certainly require the installation
of prerequisite packages in order to successfully build with support for of prerequisite packages in order to successfully build with support for
additional interfaces. See below. additional interfaces. See below.
+----------+---------+-----------------+--------------------------------------+ +----------+--------+-----------------+--------------------------------------+
| Platform |Interface| Build Variable | Prerequisite package | | Platform |Interf. | Build Variable | Prerequisite package |
|----------+---------+-----------------+--------------------------------------| |----------+--------+-----------------+--------------------------------------|
| MacOS | tty | WANT_WIN_TTY | none | | MacOS | tty | WANT_WIN_TTY | none |
|----------+---------+-----------------+--------------------------------------| |----------+--------+-----------------+--------------------------------------|
| MacOS | curses | WANT_WIN_CURSES | ncurses development libraries | | MacOS | curses | WANT_WIN_CURSES | ncurses development libraries |
|----------+---------+-----------------+--------------------------------------| |----------+--------+-----------------+--------------------------------------|
| MacOS | X11 | WANT_WIN_X11 | You will need to obtain and | | MacOS | X11 | WANT_WIN_X11 | You will need to obtain and |
| | | | install XQuartz if you want X11 | | | | | install XQuartz if you want X11 |
| | | | support in your build. | | | | | support in your build. |
| | | | (Attempting to run X11.app will | | | | | (Attempting to run X11.app will |
| | | | describe where to get it) | | | | | describe where to get it) |
| | | | | | | | | |
| | | | One possible way: | | | | | One possible way: |
| | | | brew install xquartz | | | | | brew install xquartz |
|----------+---------+-----------------+--------------------------------------| |----------+--------+-----------------+--------------------------------------|
| MacOS | Qt | WANT_WIN_QT | You will need to obtain and | | MacOS | Qt | WANT_WIN_QT | You will need to obtain and |
| | | | install Qt if you want Qt | | | | | install Qt if you want Qt |
| | | | support in your build. | | | | | support in your build. |
| | | | | | | | | |
| | | | One possible way: | | | | | One possible way: |
| | | | brew install Qt | | | | | brew install Qt |
|----------+---------+-----------------+--------------------------------------| |----------+--------+-----------------+--------------------------------------|
| Linux | tty | WANT_WIN_TTY | | | Linux | tty | WANT_WIN_TTY | |
| (Ubuntu) | | | | | (Ubuntu) | | | |
|----------+---------+-----------------+--------------------------------------| |----------+--------+-----------------+--------------------------------------|
| Linux | curses | WANT_WIN_CURSES | If it isn't already included | | Linux | curses | WANT_WIN_CURSES | If it isn't already included |
| (Ubuntu) | | | in your distribution, here is one | | (Ubuntu) | | | in your distribution, here is one |
| | | | possible way: | | | | | possible way: |
| | | | | | | | | |
| | | | sudo apt-get install libncurses-dev | | | | | sudo apt-get install libncurses-dev |
|----------+---------+-----------------+--------------------------------------| |----------+--------+-----------------+--------------------------------------|
| Linux | X11 | WANT_WIN_X11 | Here is one possible way to obtain | | Linux | X11 | WANT_WIN_X11 | Here is one possible way to obtain |
| (Ubuntu) | | | the required packages: | | (Ubuntu) | | | the required packages: |
| | | | | | | | | |
| | | |sudo apt-get install libx11-dev | | | | |sudo apt-get install libx11-dev |
| | | |sudo apt-get install libmotif-dev | | | | |sudo apt-get install libmotif-dev |
| | | |sudo apt-get install libxaw7-dev | | | | |sudo apt-get install libxaw7-dev |
| | | |sudo apt install xfonts-utils | | | | |sudo apt install xfonts-utils |
| | | |(That last one is for bdftopcf and | | | | |(That last one is for bdftopcf and |
| | | | mkfontdir utils) | | | | | mkfontdir utils) |
| | | | | | | | | |
|----------+---------+-----------------+--------------------------------------| |----------+--------+-----------------+--------------------------------------|
| Linux | Qt | WANT_WIN_QT | Here is one possible way to obtain | | Linux | Qt5 | WANT_WIN_QT | Here is one possible way to obtain |
| (Ubuntu) | | | the required packages: | | (Ubuntu) | | | the required packages: |
| | | | | | | | | |
| | | |sudo apt-get install qtbase5-dev | | | | |sudo apt-get install qtbase5-dev |
| | | |sudo apt-get install qtmultimedia5-dev| | | | |sudo apt-get install qtmultimedia5-dev|
| | | | | | | | | |
| | | |Another odd note about Qt on Linux is | | | | |Another odd note about Qt on Linux is |
| | | |that if you find you are getting the | | | | |that if you find you are getting the |
| | | |following error trying to run NetHack | | | | |following error trying to run NetHack |
| | | |after you build it with Qt support: | | | | |after you build it with Qt support: |
| | | |"error while loading shared | | | | |"error while loading shared |
| | | |libraries: libQt5Core.so.5: cannot | | | | |libraries: libQt5Core.so.5: cannot |
| | | |open shared object file: No such file | | | | |open shared object file: No such file |
| | | |or directory", | | | | |or directory", |
| | | |you may have to fix that (one-time) | | | | |you may have to fix that (one-time) |
| | | |by issuing the command below: | | | | |by issuing the command below: |
| sudo strip \ | | | | | |
| --remove-section=.note.ABI-tag/usr/lib/x86_64-linux-gnu/libQt5Core.so.5 | | sudo strip \ |
+----------+---------+-----------------+--------------------------------------+ | --remove-section=.note.ABI-tag/usr/lib/x86_64-linux-gnu/libQt5Core.so.5 |
|----------+--------+-----------------+--------------------------------------|
| Linux | Qt6 | WANT_WIN_QT | Here is one possible way to obtain |
| (Ubuntu) | | | the required packages: |
| | | | |
| | | |sudo apt-get install qt6-base-dev |
| | | |sudo apt-get install \ |
| | | | qt6-multimedia-dev |
+----------+--------+-----------------+--------------------------------------+
# NetHack 3.7 NewInstall.unx $NHDT-Date: 1652276817 2022/05/11 13:46:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.11 $ # NetHack 3.7 NewInstall.unx $NHDT-Date: 1652276817 2022/05/11 13:46:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.11 $
# Copyright (c) 2009 by Kenneth Lorber, Kensington, Maryland # Copyright (c) 2009 by Kenneth Lorber, Kensington, Maryland
+8 -2
View File
@@ -185,6 +185,7 @@ QTCXXFLAGS += $(sort $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Q
WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs) WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs)
endif # WANT_WIN_QT5 endif # WANT_WIN_QT5
ifdef WANT_WIN_QT6 ifdef WANT_WIN_QT6
ifdef QT6MANUAL
# Try some likely spots for a self-built Qt6. # Try some likely spots for a self-built Qt6.
# You'll have to change these manually before using the hints file # You'll have to change these manually before using the hints file
# if they don't match the installed location on your system. # if they don't match the installed location on your system.
@@ -204,7 +205,7 @@ QTCXXFLAGS += -I$(QTINCDIR)/QtNetwork -I$(QTINCDIR)/QtGui -I$(QTINCDIR)/QtCore
WINLIB += -L$(QTLIBDIR) -lQt6Widgets -lQt6Multimedia -lQt6Network -lQt6Gui -lQt6Core WINLIB += -L$(QTLIBDIR) -lQt6Widgets -lQt6Multimedia -lQt6Network -lQt6Gui -lQt6Core
MOCPATH = /usr/lib/qt6/libexec/moc MOCPATH = /usr/lib/qt6/libexec/moc
#/usr/lib/x86_64-linux-gnu/libQt6EglFSDeviceIntegration.so #/usr/lib/x86_64-linux-gnu/libQt6EglFSDeviceIntegration.so
endif endif # QTTOP/*
ifndef QTINCDIR ifndef QTINCDIR
ifneq ($(wildcard /usr/local/Qt6/*),) ifneq ($(wildcard /usr/local/Qt6/*),)
QTDIR=/usr/local/Qt6 QTDIR=/usr/local/Qt6
@@ -223,7 +224,12 @@ QTCXXFLAGS += -I$(QTDIR)/include/QtWidgets
MOCPATH = $(QTDIR)/libexec/moc MOCPATH = $(QTDIR)/libexec/moc
WINLIB += -L$(QTDIR)/lib -lQt6Widgets -lQt6Multimedia -lQt6Network -lQt6Gui -lQt6Core WINLIB += -L$(QTDIR)/lib -lQt6Widgets -lQt6Multimedia -lQt6Network -lQt6Gui -lQt6Core
endif # QTLOCATED endif # QTLOCATED
endif # !QTINCDIR else # !QT6MANUAL
QTCXXFLAGS += $(sort $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt6Gui Qt6Widgets Qt6Multimedia --cflags))
WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt6Gui Qt6Widgets Qt6Multimedia --libs)
MOCPATH = /usr/lib/qt6/libexec/moc
endif # QT6MANUAL
endif # WANT_WIN_QT6
ifndef QTDIR ifndef QTDIR
$(error QTDIR not defined in the environment or Makefile) $(error QTDIR not defined in the environment or Makefile)
endif # QTDIR endif # QTDIR
+5 -1
View File
@@ -764,7 +764,11 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
if (actchar[0]) { if (actchar[0]) {
QString name = menuitem; QString name = menuitem;
QAction *action = item[i].menu->addAction(name); QAction *action = item[i].menu->addAction(name);
action->setData(actchar); #if QT_VERSION < 0x060000
action->setData(actchar);
#else
action->setData(QString(actchar));
#endif
} }
} else { } else {
item[i].menu->addSeparator(); item[i].menu->addSeparator();