Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ ROM ➜ Compiling the server ➜ Configuring Rom2.4 Makefile to Compile on Linux[Debian]

Configuring Rom2.4 Makefile to Compile on Linux[Debian]

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  3  

Posted by Erythnul   (22 posts)  Bio
Date Fri 26 Jan 2007 09:22 PM (UTC)
Message
Dear Forum,

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.

CC = gcc
PROF = -O -g
NOCRYPT =
C_FLAGS = -Wall $(PROF) $(NOCRYPT)
L_FLAGS = $(PROF)
LIBS = -lcrypt

O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
alias.o ban.o comm.o const.o db.o db2.o effects.o fight.o flags.o \
handler.o healer.o interp.o lookup.o magic.o magic2.o \
music.o recycle.o save.o scan.o skills.o special.o tables.o \
update.o mob_cmds.o mob_prog.o olc.o olc_act.o olc_save.o bit.o \
mem.o string.o olc_mpcode.o remort.o bank.o board.o auction.o quest.o \
games.o kit.o freeze.o gods.o

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:
Top

Posted by Erythnul   (22 posts)  Bio
Date Reply #1 on Fri 26 Jan 2007 09:23 PM (UTC)
Message
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.

Erythnul
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Fri 26 Jan 2007 10:28 PM (UTC)

Amended on Fri 26 Jan 2007 10:29 PM (UTC) by Zeno

Message
Can you show us some of those lines in tables.h? Everything else is just a warning.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Fri 26 Jan 2007 10:32 PM (UTC)
Message
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.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Erythnul   (22 posts)  Bio
Date Reply #4 on Fri 26 Jan 2007 10:50 PM (UTC)
Message
Sure thing! Wow, I'm really impressed by the fast replies. Here is the lines directly taken from tables.h:

/* game tables */
extern const struct clan_type clan_table[MAX_CLAN];
extern const struct position_type position_table[];
extern const struct sex_type sex_table[];
extern const struct size_type size_table[];

/* flag tables */
extern const struct flag_type act_flags[];
extern const struct flag_type plr_flags[];
extern const struct flag_type affect_flags[];
extern const struct flag_type off_flags[];
extern const struct flag_type imm_flags[];
extern const struct flag_type form_flags[];
extern const struct flag_type part_flags[];
extern const struct flag_type comm_flags[];
extern const struct flag_type extra_flags[];
extern const struct flag_type wear_flags[];
extern const struct flag_type weapon_flags[];
extern const struct flag_type container_flags[];
extern const struct flag_type portal_flags[];
extern const struct flag_type room_flags[];
extern const struct flag_type exit_flags[];
extern const struct flag_type mprog_flags[];
extern const struct flag_type area_flags[];
extern const struct flag_type sector_flags[];
extern const struct flag_type door_resets[];
extern const struct flag_type wear_loc_strings[];
extern const struct flag_type wear_loc_flags[];
extern const struct flag_type res_flags[];
extern const struct flag_type imm_flags[];
extern const struct flag_type vuln_flags[];
extern const struct flag_type type_flags[];
extern const struct flag_type apply_flags[];
extern const struct flag_type sex_flags[];
extern const struct flag_type furniture_flags[];
extern const struct flag_type weapon_class[];
extern const struct flag_type apply_types[];
extern const struct flag_type weapon_type2[];
extern const struct flag_type apply_types[];
extern const struct flag_type size_flags[];
extern const struct flag_type position_flags[];
extern const struct flag_type ac_type[];
extern const struct bit_type bitvector_type[];

Here is the gcc version of my new Debian Server:

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.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Fri 26 Jan 2007 11:09 PM (UTC)
Message
I assume something like this:
extern const struct flag_type apply_types[];

Should be:
extern const struct flag_type * apply_types;


Google the error message for more details.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Erythnul   (22 posts)  Bio
Date Reply #6 on Fri 26 Jan 2007 11:32 PM (UTC)
Message
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.

Ery
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Fri 26 Jan 2007 11:38 PM (UTC)
Message
You didn't change this line, did you?
extern const struct clan_type clan_table[MAX_CLAN];


You shouldn't have.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Erythnul   (22 posts)  Bio
Date Reply #8 on Fri 26 Jan 2007 11:58 PM (UTC)
Message
Ahh.. I did, but see if I don't, the tables.h error shows up again only for that line. Hrmm, any ideas?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #9 on Sat 27 Jan 2007 12:29 AM (UTC)

Amended on Sat 27 Jan 2007 12:30 AM (UTC) by David Haley

Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Erythnul   (22 posts)  Bio
Date Reply #10 on Sat 27 Jan 2007 12:34 AM (UTC)
Message
These are the included' files atop act_comm.c:

#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#include <sys/time.h>
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "merc.h"
#include "interp.h"
#include "recycle.h"
#include "tables.h"

There is no mud.h in my source code. Rom2.4. Perhaps you meant merc.h? If so, there is no include headers in that file.

Thanks for this help, I know it's a bit time-consuming.

Ery

Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #11 on Sat 27 Jan 2007 12:42 AM (UTC)
Message
Oh yeah, I forgot this was ROM-based, not SMAUG-based... anyhow.

Well, so much for the include idea... one more thing about that though. Could you find where struct clan_type is defined?

Also, did you try the line of code I mentioned?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Erythnul   (22 posts)  Bio
Date Reply #12 on Sat 27 Jan 2007 12:52 AM (UTC)
Message
Looks' like it's defined within tables.c:

#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <stdio.h>
#include <time.h>
#include "merc.h"
#include "tables.h"

/* for clans */
const struct clan_type clan_table[MAX_CLAN] =
{
/* name, who entry, death-transfer room, independent */
/* independent should be FALSE if is a real clan */
{ "", "", ROOM_VNUM_ALTAR, TRUE },
{ "loner", "[ {RL{ro{wn{De{rr{Rs{x ] ", 3007, TRUE },
{ "Jungle", "[ {GJu{gng{Gle{x ] ", 1213, FALSE },
{ "Forester", "[{gF{Goreste{gr{x] ", 7000, FALSE },
{ "Ningyo", "[ {DN{Wi{wng{Wy{Do{x ] ", 7200, FALSE },
{ "United", "[ {WU{cn{Bi{wt{Ce{bd{x ] ", 7400, FALSE },
{ "Ksatria", "[{RK{rsatria{x ] ", 7600, FALSE },
{ "Chemists", "[{@C{@h{@e{@m{@i{@s{@t{@s{x] ", 20000, FALSE },
{ "Paradise", "[{BP{car{Gad{cis{Be{x] ", 20200, FALSE },
{ "Avatar", "[ {CAv{cat{Car{x ] ", 20200, FALSE },
{ "Bloodlust", "[ {rV{wvv{rV{x ] ", 30802, FALSE },
};

p.s. - Where should I place that tag again?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #13 on Sat 27 Jan 2007 12:58 AM (UTC)
Message
Oh, that's the array itself that's defined; I meant the type. Somewhere there should something like like:
typedef struct CLAN_TYPE { // or something
  // some data members
} clan_type;

It'll probably be in a .h file.

As for the line, put it right above the line
extern const struct clan_type clan_table[MAX_CLAN];

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Erythnul   (22 posts)  Bio
Date Reply #14 on Sat 27 Jan 2007 01:14 AM (UTC)
Message
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:

extern const struct flag_type * position_flags[];
extern const struct flag_type * ac_type[];
extern const struct bit_type * bitvector_type[];

struct flag_type
{
char *name;
int bit;
bool settable;
};

struct clan_type
{
char *name;
char *who_name;
sh_int hall;
bool independent; /* true for loners */
};

struct position_type
{
char *name;
char *short_name;
};

struct sex_type
{
char *name;
};

struct size_type
{
char *name;
};

struct bit_type
{
const struct flag_type * table;
char * help;
};

Perhaps this is where it's stuffing up?
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


95,704 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.