Compiling SMAUG 1.8b with CygWin produces errors

Posted by cmonroy on Thu 13 Dec 2007 09:48 PM — 10 posts, 33,295 views.

Mexico #0
I'm using Windows Vista with Cygwin to compile a SMAUG server according to the instructions showed on page "How to compile" but keep getting two undefined references that I think prevent me to compile succesfully the server:

- undefined reference to '_re_exec'
- undefined reference to '_crypt'

-->
collect2: ld returned 1 exit status
make[1]: *** [smaug] Error 1
make[1]: Leaving directory '/home/César Monroy/smaug1.8/src
make: *** [all] Error 2
<--

Hope anyone can help me with this. Thanks
USA #1
The crypt problem is a very common issue; if you search for 'crypt' and 'cygwin' on the forums you should find it.

Alternatively, look for the libcrypt library in the cygwin packages.
Australia Forum Administrator #2
Also search the forum for _re_exec - there are a few posts about that too.
Mexico #3
Okey... I've installed Ubuntu 7.10 to see if I could improve things but I still get some error message:

act_comm.c:3173: error: ‘CHAR_DATA’ no tiene un miembro llamado ‘speaking’
act_comm.c: En la función ‘do_traffic’:
act_comm.c:3186: error: ‘CHAR_DATA’ no tiene un miembro llamado ‘act’
act_comm.c: En la función ‘do_wartalk’:
act_comm.c:3197: error: ‘CHAR_DATA’ no tiene un miembro llamado ‘act’
act_comm.c: En la función ‘do_racetalk’:
act_comm.c:3208: error: ‘CHAR_DATA’ no tiene un miembro llamado ‘act’
act_comm.c: En la función ‘add_profane_word’:
act_comm.c:3247: aviso: declaración implícita de la función ‘strlen’
act_comm.c:3247: aviso: declaración implícita incompatible de la función interna ‘strlen’
act_comm.c:3338: aviso: declaración implícita incompatible de la función interna ‘strcat’
act_comm.c: En la función ‘is_profane’:
act_comm.c:3347: aviso: declaración implícita de la función ‘re_exec’
make[1]: *** [act_comm.o] Error 1
make[1]: se sale del directorio `/home/cmonroy/dist/src'
make: *** [all] Error 2

Any suggestions, Nick? Thanks.
USA #4
If I remember correctly, stock SMAUG 1.8 has a number of compiler errors in it. Those missing member errors you are getting ("no tiene un membro llamado ...") probably aren't due to you or your environment but are bugs in SMAUG. You might be better using SmaugFUSS from here:
http://www.smaugmuds.org/index.php?a=files&s=viewfile&fid=142

It has a lot of bug fixes, too, so I'd suggest using it anyhow. (FUSS = Fixed Up Stock Source)

Out of curiosity were there more errors than just those? I'd be a little surprised that it'd be as simple as a missing field; maybe the compiler is having a problem with the field type and therefore tosses the field.

By the way:
act_comm.c:3247: aviso: declaración implícita de la función ‘strlen’
act_comm.c:3247: aviso: declaración implícita incompatible de la función interna ‘strlen’
act_comm.c:3338: aviso: declaración implícita incompatible de la función interna ‘strcat’
act_comm.c: En la función ‘is_profane’:
act_comm.c:3347: aviso: declaración implícita de la función ‘re_exec’

The implicit declaration warnings probably aren't a big problem, especially the first three, since they'll be found when the program is linked with the runtime library. It's bad style of the SMAUG authors to have not included the proper header files.

(I'd never seen gcc output in Spanish before... yay)
Mexico #5
Thank you very much David... I'll download the FUSS and give it a try!
Mexico #6
It seems that after downloading the FUSS, I had to get the C++ compiler. The code compiles up to the comm.c, where it calls mccp.h and fails to find an included zlib.h... I have installed the zlib that is available for Ubuntu 7.10 but the compiler still complains of not finding zlib.h Any Ideas?
Amended on Fri 14 Dec 2007 07:58 AM by cmonroy
Mexico #7
Please disregard previous code... Sending finger is faster than the intelligence behind the action. Sorry

make -s smaug
Compiling o/imc.o....
Compiling o/act_comm.o....
Compiling o/act_info.o....
Compiling o/act_move.o....
Compiling o/act_obj.o....
Compiling o/act_wiz.o....
Compiling o/ban.o....
Compiling o/boards.o....
Compiling o/build.o....
Compiling o/chess.o....
Compiling o/clans.o....
Compiling o/color.o....
Compiling o/comm.o....
En el fichero incluído de comm.c:30:
mccp.h:18:18: error: zlib.h: No existe el fichero ó directorio
mccp.h:33: error: ISO C++ prohíbe la declaración de ‘z_stream’ sin tipo
mccp.h:33: error: expected ‘;’ before ‘*’ token
comm.c: In function ‘bool write_to_descriptor(DESCRIPTOR_DATA*, char*, int)’:
comm.c:1639: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1641: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1642: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1644: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1646: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1647: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1649: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1651: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1651: error: ‘Z_SYNC_FLUSH’ no se declaró en este ámbito
comm.c:1651: error: ‘deflate’ no se declaró en este ámbito
comm.c:1653: error: ‘Z_OK’ no se declaró en este ámbito
comm.c:1657: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
comm.c:1695: error: ‘struct mccp_data’ no tiene un miembro llamado ‘out_compress’
make[1]: *** [o/comm.o] Error 1
make: *** [all] Error 2
Australia Forum Administrator #8
If you install zlib you should get zlib.h which should fix your problems.

http://www.zlib.net/
USA #9
In Ubuntu you can install it from the package manager:

sudo aptitude install zlib1g-dev

You need the -dev version in order to have the include files and the libraries for compiling. The zlib you installed is probably the runtime stuff for people who don't need to compile.