I'm having some difficulties configuring my Rom2.4[Heavily Modified] codebase to start on a Linux[Debian] OS. I've been, over the past week, reading separate forums regarding this problem. From what I collected, It states that I need to add -lcrypt to the linker lines in the makefile itself.
Currently the Mud is running on a FreeBSD server just fine. I understand that FreeBSD is more of a Linux/Unix OS and from what I gather, my makefile has all the settings set so it can run via Unix just fine.
Here is the makefile I have edited to run via Linux even though it still isn't compiling properly.
rom: $(O_FILES)
rm -f rom
$(CC) $(L_FLAGS) -o rom $(O_FILES) $(LIBS)
.c.o: merc.h
$(CC) -c $(C_FLAGS) $<
At the bottom of the makefile via ".c.o: merc.h" I removed -Dunix -DNOCRYPT. I imagine those two statements themselves allowed my mud to compile fine on my FreeBSD server. Even with leaving those there...and also removing them. It still didn't compile. Now mind you, when I compile on FreeBSD, the errors I'm about to present to you do not show, but when I compile on Debian, this is what it says:
jungle@peach:~/thejunglemud/src$ make
gcc -c -Wall -O -g act_comm.c
In file included from act_comm.c:39:
interp.h:613:33: warning: no newline at end of file
In file included from act_comm.c:41:
tables.h:29: error: array type has incomplete element type
tables.h:30: error: array type has incomplete element type
tables.h:31: error: array type has incomplete element type
tables.h:32: error: array type has incomplete element type
tables.h:35: error: array type has incomplete element type
tables.h:36: error: array type has incomplete element type
tables.h:37: error: array type has incomplete element type
tables.h:38: error: array type has incomplete element type
tables.h:39: error: array type has incomplete element type
tables.h:40: error: array type has incomplete element type
tables.h:41: error: array type has incomplete element type
tables.h:42: error: array type has incomplete element type
tables.h:43: error: array type has incomplete element type
tables.h:44: error: array type has incomplete element type
tables.h:45: error: array type has incomplete element type
tables.h:46: error: array type has incomplete element type
tables.h:47: error: array type has incomplete element type
tables.h:48: error: array type has incomplete element type
tables.h:49: error: array type has incomplete element type
tables.h:50: error: array type has incomplete element type
tables.h:51: error: array type has incomplete element type
tables.h:52: error: array type has incomplete element type
tables.h:53: error: array type has incomplete element type
tables.h:54: error: array type has incomplete element type
tables.h:55: error: array type has incomplete element type
tables.h:56: error: array type has incomplete element type
tables.h:57: error: array type has incomplete element type
tables.h:58: error: array type has incomplete element type
tables.h:59: error: array type has incomplete element type
tables.h:60: error: array type has incomplete element type
tables.h:61: error: array type has incomplete element type
tables.h:62: error: array type has incomplete element type
tables.h:63: error: array type has incomplete element type
tables.h:64: error: array type has incomplete element type
tables.h:65: error: array type has incomplete element type
tables.h:66: error: array type has incomplete element type
tables.h:67: error: array type has incomplete element type
tables.h:68: error: array type has incomplete element type
tables.h:69: error: array type has incomplete element type
tables.h:70: error: array type has incomplete element type
act_comm.c: In function 'makedrunk':
act_comm.c:120: warning: implicit declaration of function 'toupper'
act_comm.c: In function 'do_war':
act_comm.c:804: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_roleplay':
act_comm.c:1142: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_grats':
act_comm.c:1327: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_quote':
act_comm.c:1505: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_question':
act_comm.c:1657: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_ooc':
act_comm.c:1809: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_music':
act_comm.c:1965: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_hero':
act_comm.c:2447: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_clocial':
act_comm.c:2555: warning: implicit declaration of function 'check_social'
act_comm.c: In function 'do_say':
act_comm.c:3505: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_shout':
act_comm.c:3689: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_tocial':
act_comm.c:3756: warning: unused variable 'count'
act_comm.c:3755: warning: unused variable 'counter'
act_comm.c:3753: warning: unused variable 'd'
act_comm.c: In function 'do_yell':
act_comm.c:4453: warning: passing argument 2 of 'bug' makes integer from pointer without a cast
act_comm.c: In function 'do_quit':
act_comm.c:5284: warning: implicit declaration of function 'talk_news'
act_comm.c: In function 'nuke_pets':
act_comm.c:5470: warning: implicit declaration of function 'raw_kill'
make: *** [act_comm.o] Error 1
jungle@peach:~/thejunglemud/src$
Any help on this subject would be greatly appreciated. My head is beginning to hurt from working on this. Thanks again for being available, I typically don't use forums.
Debian is in fact just as much of a "Linux/Unix OS" as FreeBSD is; it's just a different distribution.
On your FreeBSD machine, type gcc --version
then do the same on your Debian machine.
What you are likely to see is that Debian is using a much more recent version of gcc, maybe even version 4, which is much, much stricter about sloppiness. It doesn't let you do things that older versions let you get away with.
Really, the newer version is helping you; the kind of errors it catches, if due to sloppiness, are often an indication of not understanding really what is going on. Or, it is also often an indication that you might have made a mistake you didn't mean to make, and it's helping you find it.
Zeno is right, though; you should post some of those lines from tables.h to see what the problem is.
By the way, the crypt library has nothing to do with the problem so far. You are failing to compile and haven't gotten to the link stage yet; linking is where crypt comes into play. (Linking is when you group everything together: the files you just compiled and the external libraries they use.)
jungle@peach:~/thejunglemud/src$ gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Here is the gcc version of my FreeBSD Server:
-bash-2.05b$ gcc --version
gcc (GCC) 3.4.2 [FreeBSD] 20040728
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thank you. I was able to get tables.h to work perfectly with it. Now I'm having a few awkward errors with act_comm.c. Now I'm sure this isn't that last of them, but at least I'll be able to start going through the source code and fixing them. Here is the error:
act_comm.c:2085: error: request for member 'independent' in something not a structure or union
act_comm.c: In function 'do_clantalk':
act_comm.c:2202: error: request for member 'independent' in something not a structure or union
act_comm.c:2302: error: request for member 'name' in something not a structure or union
act_comm.c:2311: error: request for member 'hall' in something not a structure or union
What exactly does that mean? An example of the code from act_comm.c:2085: is:
if (!is_clan(ch) || clan_table[ch->clan].independent)
How do I fix these errors? Again, I really appreciate all the help. Was quite overwhelming.
In act_comm.c, does tables.h get included before or after mud.h? (Or: does mud.h include tables.h at the very beginning? Or before the structure clan_type is defined?)
EDIT: also, try putting the single line: struct clan_type;
above the clantype array declaration.
Nope, that didn't work sadly. Ok, only things I can find while searching for clan_type is this which is located right under the array types in tables.h:
Wait ...One last quick question/problem. Looks like it's masking the pfile's passwords now. So as I compiled the mud, and booted her up. The original pfiles passwords don't work now. So I created a new character with the password 12345. Saved it and logged off, looked at the pfile and it masked the pword Ksfdh.Jry. How do I fix this so all my original pfiles passwords work correctly?
The 12345 password works just fine... but my character nor anyone' elses existing pfile characters work. It asks for our password, and I put it in, and it states "wrong password" even though we know its the right one. I imagine it has something to do with the new compile??
What's probably happening is that it reads in old characters as having encrypted passwords, and then writes them back out with encryption, which is why they get messed up. Depending on how many pfiles you have, you could manually set the passwords to the correct encrypted versions; I think you can get the encrypted version of a password with a built-in game command, but that might be SMAUG-only.
Old characters dont work, new characters I make do. The old characters passwords show up normal in the pfiles themselves but when I make a new character it encrypts the passwords. Sooooo it looks like its using the original passwords to the old characters as encryptions so the pwords are ALL different to 100+ pfiles.
Ohhh no... earlier today before I found this forum I was reading old forums with similar questions and it told me I needed to add -lcrypt to my linker line in order for the makefile to compile under linux. So it should work without the -lcrypt?
Yes, it should work without the crypt library. I'm a little surprised that not having crypt would break something. Well, in any case, it's generally better to have the passwords crypted; see my previous post for a quick discussion how.
Guys, again. Thanks so very much for all the help. I got her running just fine. The transition went perfectly and there are no more errors. I really appreciate everything. You shouldn't hear from me for a while now ;)