LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Games (https://www.linuxquestions.org/questions/linux-games-33/)
-   -   Hearts Card Game for Linux. (https://www.linuxquestions.org/questions/linux-games-33/hearts-card-game-for-linux-4175708260/)

bendipa 02-18-2022 08:45 PM

Hearts Card Game for Linux.
 
I thought I found a Hearts card game for Linux here {I'm using Mint). After following the instructions to the letter on how to build this from source code, during the compilation no errors appeared on the terminal after several minutes of activity. Each step under instruction 3 was carried out. However when finished, 2 issues arose. 1) There are no instructions saying how to start this game. 2) Nothing is showing in 'usr/share/applications', which is a good clue that it hasn't installed properly, if at all. Nothing is showing in 'dpkg -l' either with a reference to 'Hearts'.

All I seem to have new is within my home folder, ie a sub-folder named 'Hearts' with a lot of files with object/source code extensions .o and .h. etc and a few folders with image files. Then I noticed under instruction 2 it mentions in brackets, files for Ubuntu 16.04 (which I did install first). But I have Mint 20.3. So I'm more confused. Was this installation meant to be used for Mint, anyway?

Would appreciate some help.

frankbell 02-18-2022 09:45 PM

Did you try a whereis search for *hearts*?

There's not much here to go on, but if errors appeared while you were attempting to build the application from sources, it is likely the build failed, even if you followed the succeeding steps. Among other things, to build from sources, kernel headers must be installed, and, to the best of my knowledge, Mint does not install kernel headers by default. (Most distros do not install kernel headers by default so as to reduce the size of the install *.iso.)

If you re-attempt the build and post the error messages, we may be able to help you.

A web search for "cards hearts linux" tells me that there is a snap package. You might take a look at that.

Here's a good tutorial on building from sources: https://www.maketecheasier.com/build...-source-linux/

enigma9o7 02-18-2022 11:44 PM

What did you do after make? Did you install it in any way? If not, its just sitting there and you can probably run it from right where it is. Or you can try
Code:

sudo make install
if the Makefile has defined a method to install it, and hopefully add a menu entry (.desktop file). If not you can do that manually.

bendipa 02-19-2022 06:23 PM

Quote:

Originally Posted by frankbell (Post 6331130)
Did you try a whereis search for *hearts*?

There's not much here to go on, but if errors appeared while you were attempting to build the application from sources, it is likely the build failed, even if you followed the succeeding steps. Among other things, to build from sources, kernel headers must be installed, and, to the best of my knowledge, Mint does not install kernel headers by default. (Most distros do not install kernel headers by default so as to reduce the size of the install *.iso.)

If you re-attempt the build and post the error messages, we may be able to help you.

A web search for "cards hearts linux" tells me that there is a snap package. You might take a look at that.

Here's a good tutorial on building from sources: https://www.maketecheasier.com/build...-source-linux/

If you read my op I said that there were no error messages shown on the terminal. The compilation appeared to complete and I had followed the instructions in step 3 to the letter. So clearly the instructions are wrong, incomplete or the package is unsuitable for Mint 20.3.

bendipa 02-19-2022 06:26 PM

Quote:

Originally Posted by enigma9o7 (Post 6331142)
What did you do after make? Did you install it in any way? If not, its just sitting there and you can probably run it from right where it is. Or you can try
Code:

sudo make install
if the Makefile has defined a method to install it, and hopefully add a menu entry (.desktop file). If not you can do that manually.

I did nothing after 'make'. There was nothing further in the instructions after that.

Here's the first part of the Makefile you mentioned. Any idea how I proceed from here?

Code:

#############################################################################
# Makefile for building: Hearts
# Generated by qmake (3.1) (Qt 5.12.8)
# Project:  Hearts.pro
# Template: app
# Command: /usr/lib/qt5/bin/qmake -o Makefile Hearts.pro
#############################################################################

MAKEFILE      = Makefile

EQ            = =

####### Compiler, tools and options

CC            = gcc
CXX          = g++
DEFINES      = -DONLINE_PLAY -DUSE_LIBALLEGRO5 -DFULL_SCREEN -DDEBUG -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS      = -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH      = -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtSvg -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++
QMAKE        = /usr/lib/qt5/bin/qmake
DEL_FILE      = rm -f
CHK_DIR_EXISTS= test -d
MKDIR        = mkdir -p
COPY          = cp -f
COPY_FILE    = cp -f
COPY_DIR      = cp -f -R
INSTALL_FILE  = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR  = cp -f -R
QINSTALL      = /usr/lib/qt5/bin/qmake -install qinstall
QINSTALL_PROGRAM = /usr/lib/qt5/bin/qmake -install qinstall -exe
DEL_FILE      = rm -f
SYMLINK      = ln -f -s
DEL_DIR      = rmdir
MOVE          = mv -f
TAR          = tar -cf
COMPRESS      = gzip -9f
DISTNAME      = Hearts1.0.0
DISTDIR = /home/bendipa2/Hearts/.tmp/Hearts1.0.0
LINK          = g++
LFLAGS        = -Wl,-O1
LIBS          = $(SUBLIBS) -lallegro_audio -lallegro_acodec -lallegro_memfile -lallegro /usr/lib/x86_64-linux-gnu/libQt5Svg.so /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Network.so /usr/lib/x86_64-linux-gnu/libQt5Core.so /usr/lib/x86_64-linux-gnu/libGL.so -lpthread 
AR            = ar cqs
RANLIB        =
SED          = sed
STRIP        = strip

####### Output directory

OBJECTS_DIR  = ./


frankbell 02-19-2022 09:45 PM

Generally, in installing from sources, make is followed by make install.

The former creates the installation package. The latter actually does the install.

ondoho 02-20-2022 04:44 AM

The executable is built right in the repo's root directory and is called - surprise - Hearts.
So, doubleclick it, or, in a terminal opened in that folder, execute
Code:

./Hearts

bendipa 02-21-2022 08:43 AM

Thanks. Only works on command line though.

teckk 02-21-2022 01:21 PM

That source has a .../Hearts-master/Hearts.pro file.

Did you run qmake in that directory? That will make you a Makefile.
Quote:

#############################################################################
# Makefile for building: Hearts
# Generated by qmake (3.1) (Qt 5.15.2)
# Project: Hearts.pro
# Template: app
# Command: /usr/bin/qmake -o Makefile Hearts.pro
#############################################################################

MAKEFILE = Makefile

EQ = =

####### Compiler, tools and options

CC = gcc
CXX = g++
DEFINES = -DONLINE_PLAY -DUSE_LIBALLEGRO5 -DFULL_SCREEN -DDEBUG -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
CFLAGS = -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -pipe -O2 -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I. -I/usr/include/qt -I/usr/include/qt/QtSvg -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtGui -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I. -I/usr/lib/qt/mkspecs/linux-g++
QMAKE = /usr/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
QINSTALL = /usr/bin/qmake -install qinstall
QINSTALL_PROGRAM = /usr/bin/qmake -install qinstall -exe
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = Hearts1.0.0
DISTDIR = <path>/hearts/Hearts-master/.tmp/Hearts1.0.0
LINK = g++
LFLAGS = -Wl,-O1 -fPIC
LIBS = $(SUBLIBS) -lallegro_audio -lallegro_acodec -lallegro_memfile -lallegro /usr/lib/libQt5Svg.so /usr/lib/libQt5Widgets.so /usr/lib/libQt5Gui.so /usr/lib/libQt5Network.so /usr/lib/libQt5Core.so -lGL -lpthread
AR = ar cqs
RANLIB =
SED = sed
STRIP = strip

####### Output directory

OBJECTS_DIR = ./

####### Files

SOURCES = client.cpp \
connect.cpp \
ctable.cpp \

<snip>.....
qrc_resources.o: qrc_resources.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_resources.o qrc_resources.cpp

moc_client.o: moc_client.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_client.o moc_client.cpp

moc_connect.o: moc_connect.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_connect.o moc_connect.cpp

moc_ctable.o: moc_ctable.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_ctable.o moc_ctable.cpp

moc_online.o: moc_online.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_online.o moc_online.cpp

moc_cgame.o: moc_cgame.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_cgame.o moc_cgame.cpp

moc_debug.o: moc_debug.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_debug.o moc_debug.cpp

moc_ccardsplayed.o: moc_ccardsplayed.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_ccardsplayed.o moc_ccardsplayed.cpp

moc_mainwindow.o: moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp

moc_clabel.o: moc_clabel.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_clabel.o moc_clabel.cpp

moc_chearts.o: moc_chearts.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chearts.o moc_chearts.cpp

moc_rules.o: moc_rules.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_rules.o moc_rules.cpp

moc_credits.o: moc_credits.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_credits.o moc_credits.cpp

moc_settings.o: moc_settings.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_settings.o moc_settings.cpp

moc_cstatistics.o: moc_cstatistics.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_cstatistics.o moc_cstatistics.cpp

####### Install

install: FORCE

uninstall: FORCE

FORCE:
I was going to compile that. I don't have all of the depends installed at the moment to build that. But I could generate a Makefile with qmake.

ondoho 02-22-2022 11:51 AM

Quote:

Originally Posted by bendipa (Post 6331806)
Thanks. Only works on command line though.

I seriously doubt that.

Steve R. 06-15-2022 06:52 PM

Just as an FYI, SourceForge has a version of Blackjack available. SourceForge Blackjack link. It was last updated on June 27, 2014.

Several years ago, I attempted to install. It failed. I have not revisited this failure. Whether this version works or not is an unknown.

I have been very bewildered that Hearts is not easily available for Linux.

CharlesJohnson 01-23-2023 09:00 AM

What did you do following making?

Luximpros 04-30-2024 05:53 PM

You know, I can totally relate to your situation. My partner is all about card games and puzzles, but I was never really into them until we stumbled upon Dominoes during the whole COVID mess. At first, I wasn't too excited about it, but I gotta say, it's grown on me big time. We even made up our own set of rules to keep things interesting.
But let me tell you about this other game I've been getting into lately: solitaire. Yeah, I know, it sounds kinda old-school, but bear with me. I stumbled upon this online version recently, and man, it's been a game-changer.


All times are GMT -5. The time now is 10:48 AM.