Compile errors

Help
J33nn
2011-08-21
2012-09-14
  • J33nn
    J33nn
    2011-08-21

    I`m trying to compile simple example of mhash usage:

    include <mhash.h>

    include <stdio.h>

    include <stdlib.h>

    int main(void)

    {

    int i;

    MHASH td;

    unsigned char buffer;

    unsigned char *hash;

    td = mhash_init(MHASH_MD5);

    if (td == MHASH_FAILED) exit(1);

    while (fread(&buffer, 1, 1, stdin) == 1) {

    mhash(td, &buffer, 1);

    }

    hash = mhash_end(td);

    printf("Hash:");

    for (i = 0; i < mhash_get_block_size(MHASH_MD5); i++) {

    printf("%.2x", hash_);

    }

    printf("\n");

    exit(0);

    }

    But can`t do it because of errors:

    /usr/local/include/mhash.h:124:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘mhash_count’

    /usr/local/include/mhash.h:125:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘mhash_get_block_size’

    /usr/local/include/mhash.h:126:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘*’ token

    /usr/local/include/mhash.h:129:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘*’ token

    /usr/local/include/mhash.h:151:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘mhash_get_hash_pblock’

    /usr/local/include/mhash.h:168:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘mhash_keygen’

    /usr/local/include/mhash.h:169:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘mhash_keygen_ext’

    /usr/local/include/mhash.h:171:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘*’ token

    /usr/local/include/mhash.h:173:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘mhash_get_keygen_salt_size’

    /usr/local/include/mhash.h:174:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘mhash_get_keygen_max_key_size’

    /usr/local/include/mhash.h:175:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
    attribute’ before ‘mhash_keygen_count’

    How to make it work? _