Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Variants

Reply
 
Thread Tools Display Modes
Old January 8, 2022, 09:00   #1
smbhax
Adept
 
Join Date: Oct 2021
Location: WA
Posts: 228
smbhax is on a distinguished road
Compiling Hellband: makefile.cyg:79 error

When attempting to compile Hellband in Cygwin, using the code and instructions here https://github.com/NickMcConnell/Ang.../tree/Hellband , I get an error message:

~~~~~~~~~~~~

smbhax@DESKTOP-64GQN1N ~/hellband/src
$ make -fmakefile.cyg
gcc -o hellband angband.res z-util.o z-virt.o z-form.o z-rand.o z-term.o variable.o tables.o util.o cave.o object1.o object2.o monster1.o monster2.o xtra1.o xtra2.o spells1.o spells2.o melee1.o melee2.o save.o files.o cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o store.o birth.o load.o wizard1.o wizard2.o generate.o dungeon.o init1.o init2.o main-win.o readdib.o quest.o -s -mwindows -lwinmm
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: files.o:files.c.bss+0xc): multiple definition of `player_uid'; variable.o:variable.c.bss+0x3d90): first defined here
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: files.o:files.c.bss+0x8): multiple definition of `player_egid'; variable.o:variable.c.bss+0x3d88): first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile.cyg:79: hellband] Error 1

~~~~~~~~~~

That was after swapping to gcc for the compiler (makefile.cyg line 43). When I tried with mingw64 instead, I got a very similar error:

~~~~~~~~~~~~

smbhax@DESKTOP-64GQN1N ~/hellband/src
$ make -fmakefile.cyg
x86_64-w64-mingw32-gcc -o hellband angband.res z-util.o z-virt.o z-form.o z-rand.o z-term.o variable.o tables.o util.o cave.o object1.o object2.o monster1.o monster2.o xtra1.o xtra2.o spells1.o spells2.o melee1.o melee2.o save.o files.o cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o store.o birth.o load.o wizard1.o wizard2.o generate.o dungeon.o init1.o init2.o main-win.o readdib.o quest.o -s -mwindows -lwinmm
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: files.o:files.c.bss+0xc): multiple definition of `player_uid'; variable.o:variable.c.bss+0x3cb0): first defined here
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: files.o:files.c.bss+0x8): multiple definition of `player_egid'; variable.o:variable.c.bss+0x3ca8): first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile.cyg:79: hellband] Error 1

~~~~~~~~~~~

Could this be some other package I'm missing?

Sorry for the horrible noob questions!
__________________
My roguelike gameplay videos

Last edited by smbhax; January 9, 2022 at 03:12.
smbhax is offline   Reply With Quote
Old January 8, 2022, 18:50   #2
backwardsEric
Swordsman
 
Join Date: Aug 2019
Posts: 296
backwardsEric is on a distinguished road
Commenting out lines 69 and 70 of files.c (extra definitions of player_uid and player_egid that duplicate ones in variable.c) should fix that linker error.

For posterity, you might edit the link in the original post so it points to Hellband 's source code at https://github.com/NickMcConnell/Ang...e/Hellband/src rather than Hengband's source code.
backwardsEric is offline   Reply With Quote
Old January 9, 2022, 03:28   #3
smbhax
Adept
 
Join Date: Oct 2021
Location: WA
Posts: 228
smbhax is on a distinguished road
Quote:
Originally Posted by backwardsEric View Post
Commenting out lines 69 and 70 of files.c (extra definitions of player_uid and player_egid that duplicate ones in variable.c) should fix that linker error.

For posterity, you might edit the link in the original post so it points to Hellband 's source code at https://github.com/NickMcConnell/Ang...e/Hellband/src rather than Hengband's source code.
Let posterity record that I am a noob who can't handle trying to compile multiple 'bands at once! Link corrected. : ) And that files.c fix did the trick!

That got me far enough to realize makefile.cyg was for compiling a Windows graphics build, and I should be using an option in makefile.org instead if I wanted a Linux/Cygwin ASCII build. And ah yes there were two 'SPECIAL_BSD" ("moves curses") sections of code in main-gcu.c that didn't want to compile either; I commented them out, which let the game compile, and *seems* to work okay in the game itself, although I don't really know what they did.



But I did eventually compile a seemingly working ASCII version of Hellband for Cygwin in Windows by doing the following, all told:

- Download the source: https://github.com/NickMcConnell/Ang...s/Hellband.zip from https://github.com/NickMcConnell/Ang.../tree/Hellband
- Extract it somewhere; these steps assume that you extract it to a new directory under your Cygwin '~' called 'hellband,' in such a way that you end up with Hellband's root directory (ie where 'hellband.cfg' is) as Cygwin's /home/[username]/hellband/

- In /src/files.c, comment out lines 69 and 70 (thanks backwardsEric!)
- In /src/main-gcu.c, comment out the 'SPECIAL_BSD' sections, ie lines 465-471 and lines 542-548 (these are 'ifdef' statements, and as backwardsEric showed here http://angband.oook.cz/forum/showthr...900#post156900 , you can comment ifdefs out by surrounding them in a null 'if' statement, with '#if 0' in the line above their '#if," and '#endif' in the line below their '#endif')
(^ I don't know how critical those SPECIAL_BSD statements were; with them gone, the game compiles, and *seems* to run okay, although when having the game quit abruptly on me due to trying different compile options at one point, I did find myself with a frozen cursor in Cygwin; I wonder if that's the kind of thing they were meant to fix. There's almost certainly a better fix for them not compiling than just commenting them out.)

- In /src/makefile.org:
-- In the '## Variation -- Only support "main-gcu.c" (not "main-x11.c")' section:
--- Uncomment lines 138 and 139, 'CFLAGS' and 'LIBS'
--- Delete '-ltermcap' from LIBS (line 139)
-- Completely comment out the '## Variation -- compfile for Ternux' section (lines 173-177)

- Create a /lib/dump directory (avoids crash using "~" "Display current knowledge" menu)

- Run Cygwin and enter:
cd hellband/src
make -fmakefile.org

Then from Cygwin's '~' home (ie 'cd ../..' from the 'src' directory) you can run

./hellband/hellband

Game notes:
- No subwindow support
- ESC is a bit laggy; '`' ('~' 'tilde' key, directly under the ESC key on most keyboards) works better (Possible fix: http://angband.oook.cz/forum/showpos...46&postcount=8 )
- Can't use SHIFT+[arrow key] to run; can use '.' then [arrow key], or SHIFT+[VI key] ('Rogue-like commands' interface option)
__________________
My roguelike gameplay videos

Last edited by smbhax; February 6, 2022 at 11:06.
smbhax is offline   Reply With Quote
Old February 6, 2022, 10:29   #4
smbhax
Adept
 
Join Date: Oct 2021
Location: WA
Posts: 228
smbhax is on a distinguished road
A few reproducible crashes or problems running Hellband locally in Cygwin:


- Selecting an option in the "Display current knowledge" menu results either in a "cannot open" error being printed, such as "Cannot open './hellband/lib/dump/cmd_a.tmp'. -more-" when trying option 1, or in the Cygwin terminal prompt abruptly appearing halfway down the screen, and no further input printing (can type "exit" to log out of Cygwin, but progress since the last Hellband save will have been lost)

^This is fixed by manually creating a "/lib/dump/" directory.


- Trying to launch the game ("./hellband/hellband") while in a terminal window smaller than 80x24 prints a warning ("Angband [sic] needs an 80x24 'curses' screen") and then further input typed into the terminal does not print
__________________
My roguelike gameplay videos

Last edited by smbhax; February 6, 2022 at 10:54.
smbhax is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling Hengband: "fatal error: util.h: No such file or directory" smbhax Variants 66 February 3, 2022 21:02
ToME compiling error Gauss ToME 4 October 13, 2018 21:19
Need help compiling Hellband konijn_ Variants 7 March 13, 2018 20:49
"Error at line 1988 of 'artifact.txt'. Record 136 contains a many entries' error. thedude Vanilla 1 December 12, 2014 04:31
Compiling using Makefile.nmake PaulBlay Vanilla 10 February 20, 2009 08:07


All times are GMT +1. The time now is 12:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.