I started the compilation test again from scratch today.
I compiled using msvs 2019.
I consulted the following article on how to compile. I used the conf.h.msvs file.
Running on Windows using Visual Studio
Compiling in the Dubug mode as a guide in this article results in the following error and does not generate an executable:
Code:
1>------ Rebuild All started: Project: TbaMUD_Eng, Configuration: Debug Win32 ------
1>act.comm.c
1>act.informative.c
1>act.item.c
1>act.movement.c
1>act.offensive.c
1>act.other.c
1>act.social.c
1>act.wizard.c
1>C:\Users\울보천사\Desktop\tbamud-master\src\act.wizard.c(4215,12): warning C4013: '_chdir' undefined; assuming extern returning int
1>C:\Users\울보천사\Desktop\tbamud-master\src\act.wizard.c(4222,9): warning C4013: 'execl' undefined; assuming extern returning int
1>aedit.c
1>asciimap.c
1>ban.c
1>boards.c
1>bsd-snprintf.c
1>castle.c
1>cedit.c
1>class.c
1>comm.c
1>C:\Users\울보천사\Desktop\tbamud-master\src\comm.c(440,13): warning C4013: 'close' undefined; assuming extern returning int
1>config.c
1>constants.c
1>db.c
1>Generating Code...
1>Compiling...
1>dg_comm.c
1>dg_db_scripts.c
1>dg_event.c
1>dg_handler.c
1>dg_misc.c
1>dg_mobcmd.c
1>dg_objcmd.c
1>dg_olc.c
1>C:\Users\울보천사\Desktop\tbamud-master\src\dg_olc.c(1,1): warning C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss
1>dg_scripts.c
1>dg_triggers.c
1>C:\Users\울보천사\Desktop\tbamud-master\src\dg_triggers.c(407,26): warning C4090: 'function': different 'const' qualifiers
1>dg_variables.c
1>dg_wldcmd.c
1>fight.c
1>genmob.c
1>genobj.c
1>genolc.c
1>genqst.c
1>genshp.c
1>genwld.c
1>genzon.c
1>Generating Code...
1>Compiling...
1>graph.c
1>handler.c
1>hedit.c
1>house.c
1>ibt.c
1>C:\Users\울보천사\Desktop\tbamud-master\src\ibt.c(515,79): warning C4133: 'function': incompatible types - from 'long *' to 'const time_t *const '
1>improved-edit.c
1>C:\Users\울보천사\Desktop\tbamud-master\src\improved-edit.c(690,44): warning C4018: '<': signed/unsigned mismatch
1>interpreter.c
1>limits.c
1>lists.c
1>magic.c
1>mail.c
1>medit.c
1>mobact.c
1>modify.c
1>msgedit.c
1>mud_event.c
1>oasis.c
1>oasis_copy.c
1>oasis_delete.c
1>oasis_list.c
1>Generating Code...
1>Compiling...
1>objsave.c
1>oedit.c
1>players.c
1>prefedit.c
1>protocol.c
1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(1391,38): warning C4018: '<=': signed/unsigned mismatch
1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(2240,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)'
1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(2241,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)'
1>qedit.c
1>quest.c
1>random.c
1>redit.c
1>sedit.c
1>shop.c
1>spec_assign.c
1>spec_procs.c
1>spells.c
1>spell_parser.c
1>C:\Users\울보천사\Desktop\tbamud-master\src\spell_parser.c(75,34): warning C4018: '<': signed/unsigned mismatch
1>tedit.c
1>utils.c
1>weather.c
1>zedit.c
1>zmalloc.c
1>Generating Code...
1>comm.obj : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _game_loop
1>comm.obj : error LNK2019: unresolved external symbol _accept@12 referenced in function _new_descriptor
1>comm.obj : error LNK2019: unresolved external symbol _bind@12 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced in function _close_socket
1>comm.obj : error LNK2019: unresolved external symbol _ioctlsocket@12 referenced in function _nonblock
1>comm.obj : error LNK2019: unresolved external symbol _htonl@4 referenced in function _get_bind_addr
1>comm.obj : error LNK2019: unresolved external symbol _htons@4 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _inet_addr@4 referenced in function _parse_ip
1>comm.obj : error LNK2019: unresolved external symbol _inet_ntoa@4 referenced in function _get_bind_addr
1>comm.obj : error LNK2019: unresolved external symbol _listen@8 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _recv@16 referenced in function _perform_socket_read
1>comm.obj : error LNK2019: unresolved external symbol _select@20 referenced in function _game_loop
1>comm.obj : error LNK2019: unresolved external symbol _send@16 referenced in function _perform_socket_write
1>comm.obj : error LNK2019: unresolved external symbol _setsockopt@20 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _socket@12 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _gethostbyaddr@12 referenced in function _new_descriptor
1>comm.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function _init_socket
1>C:\Users\울보천사\Desktop\tbamud-master\bin\TbaMud_Eng\Debug\TbaMUD_Eng.exe : fatal error LNK1120: 18 unresolved externals
1>Done building project "TbaMUD_Eng.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I will try to solve the errors one by one.
The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\act.wizard.c(4215,12): warning C4013: '_chdir' undefined; assuming extern returning int
Add the following code to the line after #include "screen.h" of the act.wizard.c file.
Code:
#ifdef CIRCLE_WINDOWS /* Includes for Win32 */
# ifdef __BORLANDC__
# include <dir.h>
# else /* MSVC */
# include <direct.h>
# endif
#endif /* CIRCLE_WINDOWS */
The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\act.wizard.c(4222,9): warning C4013: 'execl' undefined; assuming extern returning int/
comm.c file extern time_t motdmod; Add the following code to the previous line.
Code:
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
sysdep.h file Find the code below. You can find it on line 101.
Code:
#ifdef CIRCLE_WINDOWS
# include <sys\types.h>
#endif
Make the following changes.
Code:
#ifdef CIRCLE_WINDOWS
# include <sys\types.h>
# include <process.h>
#endif
The error below changes the encoding of dg_olc.c or deletes lines 263~281 of the dg_olc.c file.
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\dg_olc.c(1,1): warning C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss
The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\dg_triggers.c(407,26): warning C4090: 'function': different 'const' qualifiers
Find the next function. dg_triggers.c file 370 lins
Code:
void act_mtrigger(const char_data *ch, char *str, char_data *actor,
Make the following changes. Removed const from const char_data.
Code:
void act_mtrigger(char_data *ch, char *str, char_data *actor,
dg_scripts.h file 207 lins
Code:
void act_mtrigger(const char_data *ch, char *str,
Change it like this: Removed const from const char_data.
Code:
void act_mtrigger(char_data *ch, char *str,
The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\ibt.c(515,79): warning C4133: 'function': incompatible types - from 'long *' to 'const time_t *const '
Add the following line to the line before #include "conf.h" in the ibt.c file.
Code:
#define _USE_32BIT_TIME_T
The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\improved-edit.c(690,44): warning C4018: '<': signed/unsigned mismatch
Find the following code in the improved-edit.c file at line 690.
Code:
strncpy(replace_buffer, *string, len < max_size - 1 ? len : max_size - 1);
Change it like this: Insert (size_t).
Code:
strncpy(replace_buffer, *string, (size_t)len < max_size - 1 ? len : max_size - 1);
The following error message:
Code:
1>comm.obj : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _game_loop
1>comm.obj : error LNK2019: unresolved external symbol _accept@12 referenced in function _new_descriptor
1>comm.obj : error LNK2019: unresolved external symbol _bind@12 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced in function _close_socket
1>comm.obj : error LNK2019: unresolved external symbol _ioctlsocket@12 referenced in function _nonblock
1>comm.obj : error LNK2019: unresolved external symbol _htonl@4 referenced in function _get_bind_addr
1>comm.obj : error LNK2019: unresolved external symbol _htons@4 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _inet_addr@4 referenced in function _parse_ip
1>comm.obj : error LNK2019: unresolved external symbol _inet_ntoa@4 referenced in function _get_bind_addr
1>comm.obj : error LNK2019: unresolved external symbol _listen@8 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _recv@16 referenced in function _perform_socket_read
1>comm.obj : error LNK2019: unresolved external symbol _select@20 referenced in function _game_loop
1>comm.obj : error LNK2019: unresolved external symbol _send@16 referenced in function _perform_socket_write
1>comm.obj : error LNK2019: unresolved external symbol _setsockopt@20 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _socket@12 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _gethostbyaddr@12 referenced in function _new_descriptor
1>comm.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function _init_socket
1>comm.obj : error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function _init_socket
Add the following code to the line before #include "conf.h" in the comm.c file.
Code:
#pragma comment(lib, "Ws2_32.lib")
The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(1391,38): warning C4018: '<=': signed/unsigned mismatch
1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(2240,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)'
1>C:\Users\울보천사\Desktop\tbamud-master\src\protocol.c(2241,1): warning C4113: 'const char *(__cdecl *)()' differs in parameter lists from 'const char *(__cdecl *)(void)'
protocol.c file 1393 lines
Code:
else if ( strlen(apTrigger) <= MaxTriggerLength )
Make the following changes. (int) insert
Code:
else if ( (int)strlen(apTrigger) <= MaxTriggerLength )
2205 lines. find this Function
Code:
static const char *GetMSSP_Players()
Make the following changes. (void) insert
Code:
static const char *GetMSSP_Players(void)
2214 lines. find this Function
Code:
static const char *GetMSSP_Uptime()
Make the following changes. (void) insert
Code:
static const char *GetMSSP_Uptime(void)
The following error message:
Code:
1>C:\Users\울보천사\Desktop\tbamud-master\src\spell_parser.c(75,34): warning C4018: '<': signed/unsigned mismatch
Find the following code on line 75 of the spell_parser.c file.
Code:
if (strlen(syls[j].news) < maxlen) {
Make the following changes.
Code:
int str_len = strlen(syls[j].news);
if (str_len < maxlen) {
If you rebuild the solution, you won't see all the error messages.
I finished the build, ran the game and logged in.
Then, I entered the typo command.
As I said, the program ended.
I recalled my previous memories.
ANSI codes starting with Q cause problems and terminate the program.
QNRM, QRED, QCYN, QBRED etc
I changed the ANSI code to code starting with K.
KNRM, KRED, KGRN etc
I recompiled, ran the server and connected to the game.
When I entered only the typo command, it worked fine.
However, when I input it with arguments such as
Code:
typo submit test string test test
==> the server was down.
As I said before, this was compiled into an English original, and the typo command was also entered in English.
It was not a Korean language problem.
I think there is a problem with the ACMD (do_ibt) function.
In the following code, problems appear to occur when separating the letter title and subcmd in arg_text.
Code:
arg_text = one_argument(argument, arg);
two_arguments(argument, arg, arg2);
I brought the first word from argument to subcmd to change the order of Korean commands.
However, this time I did not change the code for the order of Korean commands.
From the second word, it will be the title or number of the letter.
This is Function returned null.
Code:
first_ibt = get_first_ibt(subcmd);
There seems to be a reason for the error because of that too.
In my opinion, separating the title and command in argument and first_ibt = get_first_ibt(subcmd); I think I need to fix the null return of the function.
The file I used for this compilation is the original file downloaded from tbamud.com. In order to solve the error message that occurs when compiling, only the above-mentioned part was modified and compiled in dubug mode.