Compile Errors with smaugFUSS 1.9 on fresh Ubuntu 8.10

Posted by Mjnbrn on Sat 20 Dec 2008 07:00 AM — 16 posts, 77,033 views.

#0
Hello,
I was wanting to install a SMAUG server for some friends of mine and I am having some issues. I am running a fresh install of Ubuntu 8.10. I already took out the -Werror flag and I am still getting alot of errors. Here they come:


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/calendar.o....
  Compiling o/chess.o....
  Compiling o/clans.o....
  Compiling o/color.o....
  Compiling o/comm.o....
In file included from comm.c:30:
mccp.h:33: error: declaration does not declare anything
mccp.h:33: error: ISO C++ forbids declaration of ‘out_compress’ with no type
In file included from comm.c:31:
sha256.h:39: error: two or more data types in declaration of ‘SHA256_CTX’
sha256.h:41: error: variable or field ‘SHA256_Init’ declared void
sha256.h:41: error: ‘SHA256_CTX’ was not declared in this scope
sha256.h:41: error: expected primary-expression before ‘)’ token
sha256.h:42: error: variable or field ‘SHA256_Update’ declared void
sha256.h:42: error: ‘SHA256_CTX’ was not declared in this scope
sha256.h:42: error: expected primary-expression before ‘,’ token
sha256.h:42: error: expected primary-expression before ‘const’
sha256.h:42: error: expected primary-expression before ‘)’ token
sha256.h:43: error: ‘SHA256_CTX’ has not been declared
sha256.h:44: error: ‘SHA256_CTX’ was not declared in this scope
sha256.h:44: error: expected primary-expression before ‘,’ token
sha256.h:44: error: expected primary-expression before ‘char’
sha256.h:44: error: initializer expression list treated as compound expression
comm.c: In function ‘bool write_to_descriptor(DESCRIPTOR_DATA*, const char*, int)’:
comm.c:1654: error: request for member ‘next_in’ in ‘* d->descriptor_data::mccp->mccp_data::out_compress’, which is of non-class type ‘int’
comm.c:1655: error: request for member ‘avail_in’ in ‘* d->descriptor_data::mccp->mccp_data::out_compress’, which is of non-class type ‘int’
comm.c:1657: error: request for member ‘avail_in’ in ‘* d->descriptor_data::mccp->mccp_data::out_compress’, which is of non-class type ‘int’
comm.c:1659: error: request for member ‘avail_out’ in ‘* d->descriptor_data::mccp->mccp_data::out_compress’, which is of non-class type ‘int’
comm.c:1660: error: request for member ‘next_out’ in ‘* d->descriptor_data::mccp->mccp_data::out_compress’, which is of non-class type ‘int’
comm.c:1662: error: request for member ‘avail_out’ in ‘* d->descriptor_data::mccp->mccp_data::out_compress’, which is of non-class type ‘int’

USA #1
Do you have zlib installed?
#2
I must, because it keeps telling me it is at the latest version.
USA #3
Hm, is SHA256 installed?

#include <sys/types.h>
#include <sha2.h>
#4
indeed. Do i need to do anything special for it to be used?
USA #5
Please show mccp.h line 33:
mccp.h:33: error: declaration does not declare anything
mccp.h:33: error: ISO C++ forbids declaration of ‘out_compress’ with no type


Also, you need not just zlib, but the dev version -- I think it's called zlib-dev or something like that. aptitude search zlib, then install the one that has 'dev' in the name.
#6
I have the dev version installed. Here is mccp.h:31-fin


struct mccp_data
{
   z_stream ; *out_compress;
   unsigned char *out_compress_buf;
}


Thanks for helping me through this.
USA #7
Quote:
z_stream ; *out_compress;


Oh! Well, that's just wrong ... I wonder why that semi-colon is in the middle there? It's not in the version I just downloaded from the website (http://www.smaugmuds.org/index.php?a=files&s=viewfile&fid=165). How odd... Well, anyhow, if you remove that, does it make the problem go away?
#8
It fixed some of it. Now i'm getting :

In file included from comm.c:31:
sha256.h:39: error: two or more data types in declaration of ‘SHA256_CTX’
sha256.h:41: error: variable or field ‘SHA256_Init’ declared void
sha256.h:41: error: ‘SHA256_CTX’ was not declared in this scope
sha256.h:41: error: expected primary-expression before ‘)’ token
sha256.h:42: error: variable or field ‘SHA256_Update’ declared void
sha256.h:42: error: ‘SHA256_CTX’ was not declared in this scope
sha256.h:42: error: expected primary-expression before ‘,’ token
sha256.h:42: error: expected primary-expression before ‘const’
sha256.h:42: error: expected primary-expression before ‘)’ token
sha256.h:43: error: ‘SHA256_CTX’ has not been declared
sha256.h:44: error: ‘SHA256_CTX’ was not declared in this scope
sha256.h:44: error: expected primary-expression before ‘,’ token
sha256.h:44: error: expected primary-expression before ‘char’
sha256.h:44: error: initializer expression list treated as compound expression
make[1]: *** [o/comm.o] Error 1
make: *** [all] Error 2

those lines read :


} SHA256_CTX;

void SHA256_Init( SHA256_CTX * );
void SHA256_Update( SHA256_CTX *, const unsigned char *, size_t );
void SHA256_Final( unsigned char[32], SHA256_CTX * );
char *SHA256_End( SHA256_CTX *, char * );
USA #9
Could you please show the whole structure definition, that is, the part from the opening curly brace to:

} SHA256_CTX;
#10

typedef struct SHA256Context
{
   int state[8];
   int count[2];
   unsigned char buf[64];
} SHA256_CTX;
USA #11
Just a guess here, but try changing:
typedef struct SHA256Context
{
   int state[8];
   int count[2];
   unsigned char buf[64];
} SHA256_CTX;

to:
struct SHA256_CTX
{
   int state[8];
   int count[2];
   unsigned char buf[64];
};


Another option is to install g++-4.2 instead of g++-4.3. I know that 4.3 is stricter than 4.2 about some things; this might be one of them.
#12
Looking better


root@mudsrv /mud/src % make
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/calendar.o....
  Compiling o/chess.o....
  Compiling o/clans.o....
  Compiling o/color.o....
  Compiling o/comm.o....
In file included from comm.c:31:
sha256.h:39: error: multiple types in one declaration
make[1]: *** [o/comm.o] Error 1
make: *** [all] Error 2


39 is the close curly bracket in that last snippet you gave me.
struct SHA256_CTX
{
   int state[8];
   int count[2];
   unsigned char buf[64];
};

Australia Forum Administrator #13
I got it to compile under Ubuntu 8.10 as follows:

  • Booted the Ubuntu 8.10 stand-alone CDROM
  • Downloaded SmaugFUSS 1.9: http://www.gammon.com.au/files/smaug/smaugfuss1.9.tgz
  • Moved the downloaded file to my home directory
  • Started a terminal session
  • Extracted the downloaded file: tar xzf smaugfuss1.9.tgz
  • Changed to source directory: cd smaugfuss/src
  • Got g++: sudo apt-get install g++
  • Got zlib development: sudo apt-get install zlib1g-dev
  • Removed the -Werror flag from the Makefile (there are heaps of warnings)
  • Built it: make
  • No errors! Tested OK.


Didn't have to make any of the edits above. Suggest you try again with a new copy of smaugfuss source.
#14
Hm. I will try that then. thanks.

That work. Thank you again. :)
Amended on Mon 22 Dec 2008 08:41 PM by Mjnbrn
USA #15
Where did you get your copy of SmaugFUSS? We were seeing actual error messages, not warnings, and I'm a little surprised that you'd get them from the same source and compiler that Nick was using, but Nick got no errors.