Welcome to the Builder Academy

Question Do these compile instructions apply to tbaMud?

More
01 May 2014 16:02 #4889 by 4Blades
WIndows compile Instructions

I compiled circlemud without any errors, but when I tried it with tbaMud, I got the below 22 errors and 18 warnings. I used MSVC++ version 6.

Thanks.
Code:
--------------------Configuration: circle - Win32 Debug-------------------- Compiling... zmalloc.c act.comm.c act.informative.c act.item.c act.movement.c act.offensive.c act.other.c act.social.c act.wizard.c c:\documents and settings\todd\desktop\tbamud-3.65\src\act.wizard.c(4176) : warning C4013: '_chdir' undefined; assuming extern returning int c:\documents and settings\todd\desktop\tbamud-3.65\src\act.wizard.c(4179) : warning C4013: 'execl' undefined; assuming extern returning int aedit.c asciimap.c ban.c boards.c bsd-snprintf.c castle.c cedit.c class.c comm.c c:\documents and settings\todd\desktop\tbamud-3.65\src\comm.c(432) : warning C4013: 'close' undefined; assuming extern returning int config.c constants.c db.c dg_comm.c dg_db_scripts.c dg_event.c dg_handler.c dg_misc.c dg_mobcmd.c dg_objcmd.c dg_olc.c dg_scripts.c c:\documents and settings\todd\desktop\tbamud-3.65\src\dg_scripts.c(2431) : warning C4018: '>' : signed/unsigned mismatch dg_triggers.c c:\documents and settings\todd\desktop\tbamud-3.65\src\dg_triggers.c(406) : warning C4090: 'function' : different 'const' qualifiers c:\documents and settings\todd\desktop\tbamud-3.65\src\dg_triggers.c(406) : warning C4022: 'script_driver' : pointer mismatch for actual parameter 1 dg_variables.c dg_wldcmd.c fight.c genmob.c genobj.c c:\documents and settings\todd\desktop\tbamud-3.65\src\genobj.c(490) : warning C4018: '>' : signed/unsigned mismatch c:\documents and settings\todd\desktop\tbamud-3.65\src\genobj.c(561) : warning C4018: '>' : signed/unsigned mismatch c:\documents and settings\todd\desktop\tbamud-3.65\src\genobj.c(579) : warning C4018: '>' : signed/unsigned mismatch genolc.c genqst.c genshp.c genwld.c genzon.c graph.c handler.c hedit.c house.c c:\documents and settings\todd\desktop\tbamud-3.65\src\house.c(222) : warning C4018: '!=' : signed/unsigned mismatch ibt.c improved-edit.c interpreter.c limits.c lists.c magic.c mail.c medit.c mobact.c modify.c msgedit.c mud_event.c oasis.c oasis_copy.c oasis_delete.c oasis_list.c objsave.c oedit.c players.c prefedit.c protocol.c c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(377) : error C2065: 'IAC' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(388) : error C2065: 'SE' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(487) : error C2065: 'SB' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(487) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(492) : error C2065: 'DO' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(492) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(493) : error C2065: 'DONT' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(493) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(494) : error C2065: 'WILL' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(494) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(495) : error C2065: 'WONT' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(495) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(500) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(871) : error C2099: initializer is not a constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(871) : error C2099: initializer is not a constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(871) : error C2065: 'TELOPT_TTYPE' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(871) : error C2099: initializer is not a constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1392) : warning C4018: '<=' : signed/unsigned mismatch c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1395) : warning C4013: 'alloca' undefined; assuming extern returning int c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1395) : warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'int ' c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1492) : error C2065: 'TELOPT_NAWS' : undeclared identifier c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1539) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1567) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1711) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1716) : warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'int ' c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(1849) : error C2051: case expression not constant c:\documents and settings\todd\desktop\tbamud-3.65\src\protocol.c(2101) : warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'int ' qedit.c quest.c random.c redit.c sedit.c shop.c spec_assign.c spec_procs.c spell_parser.c c:\documents and settings\todd\desktop\tbamud-3.65\src\spec_procs.c(114) : warning C4700: local variable 'nlen' used without having been initialized spells.c tedit.c utils.c c:\documents and settings\todd\desktop\tbamud-3.65\src\utils.c(991) : warning C4018: '<' : signed/unsigned mismatch c:\documents and settings\todd\desktop\tbamud-3.65\src\utils.c(1004) : warning C4018: '<' : signed/unsigned mismatch weather.c zedit.c Error executing cl.exe. circle.exe - 22 error(s), 18 warning(s)

Please Log in or Create an account to join the conversation.

More
03 May 2014 16:58 #4890 by thomas
It seems the MSSP-patch didn't include the necessary includes. Add this to fix the errors:
Code:
diff --git a/src/comm.c b/src/comm.c index a2847b6..45941b0 100644 --- a/src/comm.c +++ b/src/comm.c @@ -34,6 +34,7 @@ # include <dir.h> # else /* MSVC */ # include <direct.h> +# include <winsock.h> # endif # include <mmsystem.h> #endif /* CIRCLE_WINDOWS */
Also, most of the other things: change the vars to size_t either at the beginning of the file or cast when comparing. And a bug. Here's a simple fix:
Code:
--- a/src/dg_scripts.c +++ b/src/dg_scripts.c @@ -2428,7 +2428,7 @@ static void dg_letter_value(struct script_data *sc, trig_d return; } - if (num > strlen(string)) { + if ((size_t)num > strlen(string)) { script_log("Trigger #%d : dg_letter number > strlen!", GET_TRIG_VNUM(trig)) return; } diff --git a/src/spec_procs.c b/src/spec_procs.c index 0b23149..d8006f9 100644 --- a/src/spec_procs.c +++ b/src/spec_procs.c @@ -100,7 +100,7 @@ void list_skills(struct char_data *ch) { const char *overflow = "\r\n**OVERFLOW**\r\n"; int i, sortpos, ret; - size_t len = 0, nlen; + size_t len = 0; char buf2[MAX_STRING_LENGTH]; len = snprintf(buf2, sizeof(buf2), "You have %d practice session%s remaining.\r\n" @@ -111,9 +111,9 @@ void list_skills(struct char_data *ch) i = spell_sort_info[sortpos]; if (GET_LEVEL(ch) >= spell_info[i].min_level[(int) GET_CLASS(ch)]) { ret = snprintf(buf2 + len, sizeof(buf2) - len, "%-20s %s\r\n", spell_info[i].name, how_good(GET_SKILL(ch, i))); - if (len + nlen >= sizeof(buf2) || ret < 0) + if (ret < 0 || len + ret >= sizeof(buf2)) break; - len += nlen; + len += ret; } } if (len >= sizeof(buf2)) diff --git a/src/genobj.c b/src/genobj.c index 8dfcc6a..fb0efb4 100644 --- a/src/genobj.c +++ b/src/genobj.c @@ -482,7 +483,7 @@ int delete_object(obj_rnum rnum) /* oset handling, this location should be temporary */ bool oset_alias(struct obj_data *obj, char * argument) { - static int max_len = 64; + static size_t max_len = 64; int i = GET_OBJ_RNUM(obj); skip_spaces(&argument); @@ -553,7 +554,7 @@ bool oset_apply(struct obj_data *obj, char * argument) bool oset_short_description(struct obj_data *obj, char * argument) { - static int max_len = 64; + static size_t max_len = 64; int i = GET_OBJ_RNUM(obj); skip_spaces(&argument); @@ -571,7 +572,7 @@ bool oset_short_description(struct obj_data *obj, char * arg bool oset_long_description(struct obj_data *obj, char * argument) { - static int max_len = 128; + static size_t max_len = 128; int i = GET_OBJ_RNUM(obj); skip_spaces(&argument); diff --git a/src/ibt.c b/src/ibt.c index 10a81b5..6d30070 100755 --- a/src/ibt.c +++ b/src/ibt.c @@ -518,7 +518,7 @@ ACMD(do_ibt) } else { send_to_char(ch, "%s%s by %s%s\r\n",QCYN, ibt_types[subcmd], QYEL, ibtData->name); - send_to_char(ch, "%sSubmitted: %s%s", QCYN, QYEL, ibtData->dated ? ctime(&ibtData->dated) : "Unknown\r\n"); + send_to_char(ch, "%sSubmitted: %s%s", QCYN, QYEL, ibtData->dated ? ctime((const time_t*)&ibtData->dated) : "Unknown\r\n"); if (GET_LEVEL(ch) >= LVL_IMMORT) { send_to_char(ch, "%sLevel: %s%d\r\n",QCYN, QYEL, ibtData->level); send_to_char(ch, "%sRoom : %s%d\r\n",QCYN, QYEL, ibtData->room); diff --git a/src/utils.c b/src/utils.c index c0b8594..f63de1a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -983,7 +983,8 @@ void char_from_furniture(struct char_data *ch) */ void column_list(struct char_data *ch, int num_cols, const char **list, int list_length, bool show_nums) { - int num_per_col, col_width,r,c,i, offset=0, len=0, temp_len, max_len=0; + size_t max_len = 0; + int num_per_col, col_width,r,c,i, offset=0, len=0, temp_len; char buf[MAX_STRING_LENGTH]; /* Work out the longest list item */ @@ -1010,7 +1011,7 @@ void column_list(struct char_data *ch, int num_cols, const char **list, int list if (show_nums) col_width-=4; - if (col_width < max_len) + if (col_width < 0 || (size_t)col_width < max_len) log("Warning: columns too narrow for correct output to %s in simple_column_list (utils.c)", GET_NAME(ch)); /* Calculate how many list items there should be per column */

Please Log in or Create an account to join the conversation.

Time to create page: 0.186 seconds