MAngBand on Linux

General discussion about the game. Pull up a stool and tell us your tale!
Arkandor
Mean-Looking Mercenary
Posts: 6
Joined: Wed 21.01.2004, 15:10
Location: Austria

Re: MAngBand on Linux

Post by Arkandor » Thu 22.01.2004, 16:29

could you post the output of "gcc -v" ?

compiled without any switches like "make CC=gcc-3.3.2"?

just a guess ...

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: MAngBand on Linux

Post by Berendol » Fri 23.01.2004, 08:58

[quote author=n00b link=board=GQ;num=1064007718;start=0#14 date=01/22/04 at 11:18:21]Uff... ???

I just installed MDK 9.2...
Everything went fine until the point of compiling.
I think X11 is working fine, but I get huge amounts of errors from main-gcu.c
in example:  "client/main-gcu.c:907: error: syntax error before ')' token"

There are like 30 errors like that, including invalid use or undefined type, dereferencing pointer to incomplete type etc...

and I've got no coding experience whatsoever, so help is really appreciated! [/quote]

OK. I'll help.

First thing I need to know: Did you alter the makefile? If so, how?

Second thing I need to know: What version of MAngband are you trying to compile, and where did it come from?

Third thing I need to know: Did you alter any of the source code?

Fourth thing: Like Arkandor said, post the output of 'gcc -v'.

It's possible that your gcc options are set to something strange. Hopefully we can iron this out.

Line 907 in that file, in stock mangband.org 0.7.2a, is this:
[tt]if (initscr() == (WINDOW*)ERR) return (-1);[/tt]
So that token error is... confusing, to say the least!
By appreciation, we make excellence in others our own property. (Voltaire)

n00b

Re: MAngBand on Linux

Post by n00b » Fri 23.01.2004, 09:26

Ok, here's the output of 'gcc -v':
-------
Reading specs from /usr//bin/../lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/li      b --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-thr      eads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-      languages=c,c++,ada,f77,objc,java,pascal --host=i586-mandrake-linux-gnu --with-s      ystem-zlib
Thread model: posix
gcc version 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)
-------

Trying to compile 0.7.2a(downloaded from here) and I didn't make any alterations..

Arkandor
Mean-Looking Mercenary
Posts: 6
Joined: Wed 21.01.2004, 15:10
Location: Austria

Re: MAngBand on Linux

Post by Arkandor » Fri 23.01.2004, 14:10

hmm, i have no gcc 3.3.1 at hand, but i tried it tonight with gcc 3.3.2 and 3.3.3 and it worked

i rather think it is missing some devel- packages and libraries

is there a chance that there is a line in the output which says something like "... File not found"? (usually it is just one line, so it is easily overlooked)

Perhaps it's a good idea to post the output of the compilation if you don't have to type it  ;)

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: MAngBand on Linux

Post by Berendol » Fri 23.01.2004, 14:44

Please post the output of running make in the top-level mangband directory, so we coders can ruminate over it. Do not attempt to clean up what has already compiled successfully, since we only need the errors from that one file (plus the confirmation of previous files) to determine what the problem is. The real problem will lie in the first few lines of errors, but I don't know ahead of time how far down the indicators will be.

If you suspect that you lack the proper development software, please try downloading that to see if it fixes the issue before you post here. In well over 90% of the cases I've solved, that was the problem.

Unofficially, your troubles sound like they stem from a header not being included somewhere, a missing semicolon, or a missing block end brace. But this is not a problem with any known configuration, so perhaps your system is broken. We'll see.
By appreciation, we make excellence in others our own property. (Voltaire)

n00b

Re: MAngBand on Linux

Post by n00b » Sat 31.01.2004, 06:34

I tried with gcc 3.3.2, but it started complaining about missing cc1  :-/

Here's the output of make (with gcc 3.3.1):
-----
( cd src; make )
make[1]: Entering directory `/home/admin/mangband_0.7.2a/src'
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o common/z-util.o -c common/z-util.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o common/z-virt.o -c common/z-virt.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o common/z-form.o -c common/z-form.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o common/z-rand.o -c common/z-rand.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o common/net-unix.o -c common/net-unix.c
common/net-unix.c:35: warning: `sourceid' defined but not used
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o common/sockbuf.o -c common/sockbuf.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o common/net-ibm.o -c common/net-ibm.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/z-term.o -c client/z-term.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/c-util.o -c client/c-util.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/c-cmd.o -c client/c-cmd.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/c-inven.o -c client/c-inven.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/c-files.o -c client/c-files.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/c-tables.o -c client/c-tables.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/c-store.o -c client/c-store.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/c-init.o -c client/c-init.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/variable.o -c client/variable.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/main-ibm.o -c client/main-ibm.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/main-cap.o -c client/main-cap.c
gcc -Wall -g -pipe -D"USE_X11" -D"USE_GCU" -I/usr/include/ncurses -o client/main-gcu.o -c client/main-gcu.c
client/main-gcu.c:61:22: ncurses.h: No such file or directory
client/main-gcu.c:75: error: syntax error before "WINDOW"
client/main-gcu.c:75: warning: no semicolon at end of struct or union
client/main-gcu.c:291: warning: type defaults to `int' in declaration of `x_offset'
client/main-gcu.c: In function `Term_xtra_gcu_alive':
client/main-gcu.c:479: warning: implicit declaration of function `nocbreak'
client/main-gcu.c:480: warning: implicit declaration of function `echo'
client/main-gcu.c:481: warning: implicit declaration of function `nl'
client/main-gcu.c:487: warning: implicit declaration of function `refresh'
client/main-gcu.c:494: warning: implicit declaration of function `mvcur'
client/main-gcu.c:494: error: `curscr' undeclared (first use in this function)
client/main-gcu.c:494: error: (Each undeclared identifier is reported only once
client/main-gcu.c:494: error: for each function it appears in.)
client/main-gcu.c:494: error: `LINES' undeclared (first use in this function)
client/main-gcu.c:498: warning: implicit declaration of function `endwin'
client/main-gcu.c:512: warning: implicit declaration of function `cbreak'
client/main-gcu.c:513: warning: implicit declaration of function `noecho'
client/main-gcu.c:514: warning: implicit declaration of function `nonl'
client/main-gcu.c: In function `Term_init_gcu':
client/main-gcu.c:538: warning: implicit declaration of function `wclear'
client/main-gcu.c:538: error: dereferencing pointer to incomplete type
client/main-gcu.c:541: warning: implicit declaration of function `wmove'
client/main-gcu.c:541: error: dereferencing pointer to incomplete type
client/main-gcu.c:544: warning: implicit declaration of function `wrefresh'
client/main-gcu.c:544: error: dereferencing pointer to incomplete type
client/main-gcu.c: In function `Term_nuke_gcu':
client/main-gcu.c:559: warning: implicit declaration of function `delwin'
client/main-gcu.c:559: error: dereferencing pointer to incomplete type
client/main-gcu.c:572: error: `curscr' undeclared (first use in this function)
client/main-gcu.c:572: error: `LINES' undeclared (first use in this function)
client/main-gcu.c: In function `Term_xtra_gcu_event':
client/main-gcu.c:604: warning: implicit declaration of function `nodelay'
client/main-gcu.c:604: error: `stdscr' undeclared (first use in this function)
client/main-gcu.c:607: warning: implicit declaration of function `getch'
client/main-gcu.c:610: error: `ERR' undeclared (first use in this function)
client/main-gcu.c: In function `Term_xtra_gcu':
client/main-gcu.c:706: warning: implicit declaration of function `touchwin'
client/main-gcu.c:706: error: dereferencing pointer to incomplete type
client/main-gcu.c:707: error: dereferencing pointer to incomplete type
client/main-gcu.c:717: error: dereferencing pointer to incomplete type
client/main-gcu.c:724: warning: implicit declaration of function `curs_set'
client/main-gcu.c: In function `Term_curs_gcu':
client/main-gcu.c:761: error: dereferencing pointer to incomplete type
client/main-gcu.c: In function `Term_wipe_gcu':
client/main-gcu.c:777: error: dereferencing pointer to incomplete type
client/main-gcu.c:780: error: dereferencing pointer to incomplete type
client/main-gcu.c:782: warning: implicit declaration of function `wclrtoeol'
client/main-gcu.c:782: error: dereferencing pointer to incomplete type
client/main-gcu.c:788: warning: implicit declaration of function `waddch'
client/main-gcu.c:788: error: dereferencing pointer to incomplete type
client/main-gcu.c: In function `Term_text_gcu':
client/main-gcu.c:816: error: dereferencing pointer to incomplete type
client/main-gcu.c:824: warning: implicit declaration of function `waddstr'
client/main-gcu.c:824: error: dereferencing pointer to incomplete type
client/main-gcu.c: In function `term_data_init':
client/main-gcu.c:834: error: dereferencing pointer to incomplete type
client/main-gcu.c:839: error: dereferencing pointer to incomplete type
client/main-gcu.c:839: warning: implicit declaration of function `newwin'
client/main-gcu.c:841: error: dereferencing pointer to incomplete type
client/main-gcu.c:848: error: dereferencing pointer to incomplete type
client/main-gcu.c:849: error: dereferencing pointer to incomplete type
client/main-gcu.c: In function `init_gcu':
client/main-gcu.c:907: warning: implicit declaration of function `initscr'
client/main-gcu.c:907: error: `WINDOW' undeclared (first use in this function)
client/main-gcu.c:907: error: syntax error before ')' token
client/main-gcu.c:912: error: `LINES' undeclared (first use in this function)
client/main-gcu.c:912: error: `COLS' undeclared (first use in this function)
client/main-gcu.c:1008: error: `stdscr' undeclared (first use in this function)
client/main-gcu.c:1056: error: invalid use of undefined type `struct term_data'
client/main-gcu.c:1064: error: invalid use of undefined type `struct term_data'
client/main-gcu.c:1066: error: invalid use of undefined type `struct term_data'
client/main-gcu.c: At top level:
client/main-gcu.c:80: error: storage size of `data' isn't known
client/main-gcu.c:291: warning: `x_offset' defined but not used
make[1]: *** [client/main-gcu.o] Error 1
make[1]: Leaving directory `/home/admin/mangband_0.7.2a/src'
make: *** [dummy] Error 2
-----

cheez that was long listing..

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: MAngBand on Linux

Post by Berendol » Sat 31.01.2004, 11:09

n00b: Your problem is that you don't have the ncurses development files. You need those (and I did say so in my original Guide posting, on the first page of this thread) so go get them and install them.

This line should have immediately tipped you off to this missing requirement:
[tt]client/main-gcu.c:61:22: ncurses.h: No such file or directory[/tt]
By appreciation, we make excellence in others our own property. (Voltaire)

Crimson
King Lich
Posts: 315
Joined: Sat 26.10.2002, 15:00
Location: Mangband Project Team Member
Contact:

Re: MAngBand on Linux

Post by Crimson » Sat 31.01.2004, 14:29

ncurses.h is included in the libncurses5dev package, or the equivalent for your system.  you'll also need the lib5ncurses package to get your terminfo files, etc (I think, but don't hold me to that.)
Are you not entertained?
Is this not what you came here for?

-- Maximus Decimus Meridias, The Gladiator

n00b

Re: MAngBand on Linux

Post by n00b » Sun 01.02.2004, 08:46

Sorry guys, my bad (I thought ncurses was something that would be generated during compiling).

The good news is: I got it working
The bad news is: the experience system is f*cked up. A new level every 200exp ??? A bit too easy, I'd say. I'm not sure from where to change this, so hints are again appreciated ;)

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: MAngBand on Linux

Post by Berendol » Sun 01.02.2004, 09:30

Good old Crimson. Desperately trying to be nice and cancel out my flame with a more informative message :)

* libncurses and libncurses software development files (libncurses-devel)

So, you say it takes 200 exp to level on your server! Can I play there? Just kidding, of course. That EXP/level gain rate is definitely screwed up unless you're in the upper pre-10 range. Try playing a few more levels and see if it increases. What character levels have you tested this at, and what were their races and classes? Was there a change when you leveled up? If so, what? Test your server as-is with a human warrior and post the first five or so level requirements here for me. If it's right and you want to tweak it more, I could point you in the right direction. But there's no sense in a temporary fix if it's really broken... it's important to correctly solve the problem at hand so you don't have to do it again later.

Are you 100% sure that you or anyone else who might use your computer didn't tweak any of the .c or .h files in common/ or server/? It might be a good idea to remove (with -rf) your mangband directory and start over with a fresh tarball...
By appreciation, we make excellence in others our own property. (Voltaire)

n00b

Re: MAngBand on Linux

Post by n00b » Sun 01.02.2004, 09:32

Weird. Exp system started working after server reboot.
I'll try to put the server online in a few days. I still have some changes to make :)

Crimson
King Lich
Posts: 315
Joined: Sat 26.10.2002, 15:00
Location: Mangband Project Team Member
Contact:

Re: MAngBand on Linux

Post by Crimson » Sun 01.02.2004, 13:21

That is very odd, for a variety of reasons, the least of not being that the exp system has no input from randomness.  Now, had it some dependance, then I'd have told you to run rand_test and send me the results, because I would have thought you'd triggered some heretofore unseen bug in the PSRNG (Pseudo-Random Number Generator), or that your system was low on entropy pool entries, but that's not the case here.   Exp is a straight computation based on race/class.

Gremlins sometimes do exist.
Are you not entertained?
Is this not what you came here for?

-- Maximus Decimus Meridias, The Gladiator

n00b

Re: MAngBand on Linux

Post by n00b » Tue 03.02.2004, 10:09

Ok, testing continues.
Yesterday I rebooted my computer, so I also had to shut down the server. After the reboot I found out that all the items from the house I bought were gone (bug?)
The chars didn't lose exp/stuff, so all OK for them.

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: MAngBand on Linux

Post by Berendol » Tue 03.02.2004, 11:00

How did you shut down the server? If you [tt]kill -9[/tt] it, or leave it running so the system has to kill it when you reboot, forget about a correct server savefile - it will be corrupt.

My preferred shutdown procedure for a detached server using [tt]runserv[/tt] is to use [tt]mangconsole[/tt], then [tt]kill[/tt] the [tt]runserv[/tt] process (find its PID with [tt]ps -aux | grep runserv[/tt]), then make sure that it shut down the server by using [tt]mangconsole[/tt] again. That way you can be sure that you have a working savefile.

Sounds to me like you've got some strange randomness happening. Are you sure you're not running a compromised system? You might do well to check for virii - yes, Linux viruses do exist - and make sure you don't use your computer or run things as [tt]root[/tt]. I am at a loss for Linux virus scanners, but you can google them up pretty quick I'm sure. If you're clean, then try checking your filesystem at the physical level. I don't know what your filesystem is so I can't tell you the proper command. I personally prefer Ext3 and ReiserFS, whose commands are e2fsck and reiserfsck in the Debian, Red Hat, Fedora, and Gentoo distributions. (At least the versions I've used.)
By appreciation, we make excellence in others our own property. (Voltaire)

Arkandor
Mean-Looking Mercenary
Posts: 6
Joined: Wed 21.01.2004, 15:10
Location: Austria

Re: MAngBand on Linux

Post by Arkandor » Tue 03.02.2004, 14:33

although virii exist for linux, rootkits are the more common security holes

check with the chkrootkit tool

Post Reply