views:

116

answers:

1

Hi, I want to compile the beecrypt library under VS2008. But several of the below structures produce a syntax error (C2059 syntax error: '.'):

const hashFunction md5 = {
.name = "MD5",
.paramsize = sizeof(md5Param),
.blocksize = 64,
.digestsize = 16,
.reset = (hashFunctionReset) md5Reset,
.update = (hashFunctionUpdate) md5Update,
.digest = (hashFunctionDigest) md5Digest
};

VC++ does not accept the dots in the beginning. If I comment the above, I get Linking errors later (LNK2001 unresolved symbol _md5) - so I guess it has to be uncommented.

What is this structure? For what do I need it? How do I tell VS2008 to compile it?

+6  A: 

This type of struct initialization is a feature of C99 (ISO/IEC 9899:1999). It is not valid C++ or C prior to the latest standard.

Visual Studio 2008 only supports C90 (aka C89), so this isn't going to compile.

Edit It looks like BeeCrypt very recently changed to require a C99 compiler which effectively rules out Visual Studio. You other option is to use an older version of BeeCrypt.

Charles Bailey