Compilation error: Bad MySql headers?

Help
2006-05-31
2013-04-23
  • MARTIN Pierre
    MARTIN Pierre
    2006-05-31

    Hello everybody,

    I'm trying to get mod_auth_mysql to work with a pretty fine working install of Apache 2.2 (From sources [/usr/local/httpd]) and MySql 5 (From a backported .deb [Standard path]).

    I am issuing the command:
    apxs -c -lmysqlclient -lm -lz mod_auth_mysql.c
    to compile the mod. The problem does *not* comes from the fact i'm not using any mysql include dir, because i changed the file mod_auth_mysql.c to "include "/usr/include/mysql/mysql.h".

    I have tried with a lot of MySql headers versions:
    6, 9, 10, 12, 14, 15 (default debian packages libmysqlclientxx-dev).

    Here is the message i got while trying to compile, i think it is the same with all headers versions.

    Thanks a lot for any kind of help,
    Regards.
    Pierre.

    <pre>
    /usr/local/httpd/build/libtool --silent --mode=compile gcc -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -O2 -pthread -I/usr/local/httpd/include  -I/usr/local/httpd/include   -I/usr/local/httpd/include   -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
    mod_auth_mysql.c:591: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:591: error: initializer element is not constant
    mod_auth_mysql.c:591: error: (near initialization for `mysql_auth_cmds[0].cmd_data')
    mod_auth_mysql.c:591: error: initializer element is not constant
    mod_auth_mysql.c:591: error: (near initialization for `mysql_auth_cmds[0]')
    mod_auth_mysql.c:595: error: initializer element is not constant
    mod_auth_mysql.c:595: error: (near initialization for `mysql_auth_cmds[1].func')
    mod_auth_mysql.c:595: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:595: error: initializer element is not constant
    mod_auth_mysql.c:595: error: (near initialization for `mysql_auth_cmds[1].cmd_data')
    mod_auth_mysql.c:595: error: initializer element is not constant
    mod_auth_mysql.c:595: error: (near initialization for `mysql_auth_cmds[1]')
    mod_auth_mysql.c:599: error: initializer element is not constant
    mod_auth_mysql.c:599: error: (near initialization for `mysql_auth_cmds[2].func')
    mod_auth_mysql.c:599: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:599: error: initializer element is not constant
    mod_auth_mysql.c:599: error: (near initialization for `mysql_auth_cmds[2].cmd_data')
    mod_auth_mysql.c:599: error: initializer element is not constant
    mod_auth_mysql.c:599: error: (near initialization for `mysql_auth_cmds[2]')
    mod_auth_mysql.c:603: error: initializer element is not constant
    mod_auth_mysql.c:603: error: (near initialization for `mysql_auth_cmds[3].func')
    mod_auth_mysql.c:603: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:603: error: initializer element is not constant
    mod_auth_mysql.c:603: error: (near initialization for `mysql_auth_cmds[3].cmd_data')
    mod_auth_mysql.c:603: error: initializer element is not constant
    mod_auth_mysql.c:603: error: (near initialization for `mysql_auth_cmds[3]')
    mod_auth_mysql.c:607: error: initializer element is not constant
    mod_auth_mysql.c:607: error: (near initialization for `mysql_auth_cmds[4].func')
    mod_auth_mysql.c:607: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:607: error: initializer element is not constant
    mod_auth_mysql.c:607: error: (near initialization for `mysql_auth_cmds[4].cmd_data')
    mod_auth_mysql.c:607: error: initializer element is not constant
    mod_auth_mysql.c:607: error: (near initialization for `mysql_auth_cmds[4]')
    mod_auth_mysql.c:611: error: initializer element is not constant
    mod_auth_mysql.c:611: error: (near initialization for `mysql_auth_cmds[5].func')
    mod_auth_mysql.c:611: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:611: error: initializer element is not constant
    mod_auth_mysql.c:611: error: (near initialization for `mysql_auth_cmds[5].cmd_data')
    mod_auth_mysql.c:611: error: initializer element is not constant
    mod_auth_mysql.c:611: error: (near initialization for `mysql_auth_cmds[5]')
    mod_auth_mysql.c:615: error: initializer element is not constant
    mod_auth_mysql.c:615: error: (near initialization for `mysql_auth_cmds[6].func')
    mod_auth_mysql.c:615: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:615: error: initializer element is not constant
    mod_auth_mysql.c:615: error: (near initialization for `mysql_auth_cmds[6].cmd_data')
    mod_auth_mysql.c:615: error: initializer element is not constant
    mod_auth_mysql.c:615: error: (near initialization for `mysql_auth_cmds[6]')
    mod_auth_mysql.c:619: error: initializer element is not constant
    mod_auth_mysql.c:619: error: (near initialization for `mysql_auth_cmds[7].func')
    mod_auth_mysql.c:619: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:619: error: initializer element is not constant
    mod_auth_mysql.c:619: error: (near initialization for `mysql_auth_cmds[7].cmd_data')
    mod_auth_mysql.c:619: error: initializer element is not constant
    mod_auth_mysql.c:619: error: (near initialization for `mysql_auth_cmds[7]')
    mod_auth_mysql.c:623: error: initializer element is not constant
    mod_auth_mysql.c:623: error: (near initialization for `mysql_auth_cmds[8].func')
    mod_auth_mysql.c:623: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:623: error: initializer element is not constant
    mod_auth_mysql.c:623: error: (near initialization for `mysql_auth_cmds[8].cmd_data')
    mod_auth_mysql.c:623: error: initializer element is not constant
    mod_auth_mysql.c:623: error: (near initialization for `mysql_auth_cmds[8]')
    mod_auth_mysql.c:627: error: initializer element is not constant
    mod_auth_mysql.c:627: error: (near initialization for `mysql_auth_cmds[9].func')
    mod_auth_mysql.c:627: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:627: error: initializer element is not constant
    mod_auth_mysql.c:627: error: (near initialization for `mysql_auth_cmds[9].cmd_data')
    mod_auth_mysql.c:627: error: initializer element is not constant
    mod_auth_mysql.c:627: error: (near initialization for `mysql_auth_cmds[9]')
    mod_auth_mysql.c:631: error: initializer element is not constant
    mod_auth_mysql.c:631: error: (near initialization for `mysql_auth_cmds[10].func')
    mod_auth_mysql.c:631: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:631: error: initializer element is not constant
    mod_auth_mysql.c:631: error: (near initialization for `mysql_auth_cmds[10].cmd_data')
    mod_auth_mysql.c:631: error: initializer element is not constant
    mod_auth_mysql.c:631: error: (near initialization for `mysql_auth_cmds[10]')
    mod_auth_mysql.c:635: error: initializer element is not constant
    mod_auth_mysql.c:635: error: (near initialization for `mysql_auth_cmds[11].func')
    mod_auth_mysql.c:635: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:635: error: initializer element is not constant
    mod_auth_mysql.c:635: error: (near initialization for `mysql_auth_cmds[11].cmd_data')
    mod_auth_mysql.c:635: error: initializer element is not constant
    mod_auth_mysql.c:635: error: (near initialization for `mysql_auth_cmds[11]')
    mod_auth_mysql.c:639: error: initializer element is not constant
    mod_auth_mysql.c:639: error: (near initialization for `mysql_auth_cmds[12].func')
    mod_auth_mysql.c:639: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:639: error: initializer element is not constant
    mod_auth_mysql.c:639: error: (near initialization for `mysql_auth_cmds[12].cmd_data')
    mod_auth_mysql.c:639: error: initializer element is not constant
    mod_auth_mysql.c:639: error: (near initialization for `mysql_auth_cmds[12]')
    mod_auth_mysql.c:643: error: initializer element is not constant
    mod_auth_mysql.c:643: error: (near initialization for `mysql_auth_cmds[13].func')
    mod_auth_mysql.c:643: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:643: error: initializer element is not constant
    mod_auth_mysql.c:643: error: (near initialization for `mysql_auth_cmds[13].cmd_data')
    mod_auth_mysql.c:643: error: initializer element is not constant
    mod_auth_mysql.c:643: error: (near initialization for `mysql_auth_cmds[13]')
    mod_auth_mysql.c:651: error: initializer element is not constant
    mod_auth_mysql.c:651: error: (near initialization for `mysql_auth_cmds[14].func')
    mod_auth_mysql.c:651: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:651: error: initializer element is not constant
    mod_auth_mysql.c:651: error: (near initialization for `mysql_auth_cmds[14].cmd_data')
    mod_auth_mysql.c:651: error: initializer element is not constant
    mod_auth_mysql.c:651: error: (near initialization for `mysql_auth_cmds[14]')
    mod_auth_mysql.c:655: error: initializer element is not constant
    mod_auth_mysql.c:655: error: (near initialization for `mysql_auth_cmds[15].func')
    mod_auth_mysql.c:655: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:655: error: initializer element is not constant
    mod_auth_mysql.c:655: error: (near initialization for `mysql_auth_cmds[15].cmd_data')
    mod_auth_mysql.c:655: error: initializer element is not constant
    mod_auth_mysql.c:655: error: (near initialization for `mysql_auth_cmds[15]')
    mod_auth_mysql.c:659: error: initializer element is not constant
    mod_auth_mysql.c:659: error: (near initialization for `mysql_auth_cmds[16].func')
    mod_auth_mysql.c:659: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:659: error: initializer element is not constant
    mod_auth_mysql.c:659: error: (near initialization for `mysql_auth_cmds[16].cmd_data')
    mod_auth_mysql.c:659: error: initializer element is not constant
    mod_auth_mysql.c:659: error: (near initialization for `mysql_auth_cmds[16]')
    mod_auth_mysql.c:663: error: initializer element is not constant
    mod_auth_mysql.c:663: error: (near initialization for `mysql_auth_cmds[17].func')
    mod_auth_mysql.c:663: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:663: error: initializer element is not constant
    mod_auth_mysql.c:663: error: (near initialization for `mysql_auth_cmds[17].cmd_data')
    mod_auth_mysql.c:663: error: initializer element is not constant
    mod_auth_mysql.c:663: error: (near initialization for `mysql_auth_cmds[17]')
    mod_auth_mysql.c:667: error: initializer element is not constant
    mod_auth_mysql.c:667: error: (near initialization for `mysql_auth_cmds[18].func')
    mod_auth_mysql.c:667: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:667: error: initializer element is not constant
    mod_auth_mysql.c:667: error: (near initialization for `mysql_auth_cmds[18].cmd_data')
    mod_auth_mysql.c:667: error: initializer element is not constant
    mod_auth_mysql.c:667: error: (near initialization for `mysql_auth_cmds[18]')
    mod_auth_mysql.c:671: error: initializer element is not constant
    mod_auth_mysql.c:671: error: (near initialization for `mysql_auth_cmds[19].func')
    mod_auth_mysql.c:671: error: syntax error before "mysql_auth_config_rec"
    mod_auth_mysql.c:671: error: initializer element is not constant
    mod_auth_mysql.c:671: error: (near initialization for `mysql_auth_cmds[19].cmd_data')
    mod_auth_mysql.c:671: error: initializer element is not constant
    mod_auth_mysql.c:671: error: (near initialization for `mysql_auth_cmds[19]')
    mod_auth_mysql.c:675: error: initializer element is not constant
    mod_auth_mysql.c:675: error: (near initialization for `mysql_auth_cmds[20]')
    mod_auth_mysql.c: In function `format_request':
    mod_auth_mysql.c:947: warning: pointer/integer type mismatch in conditional expression
    apxs:Error: Command failed with rc=65536
    </pre>

     
    • Jerry Stuckle
      Jerry Stuckle
      2006-10-17

      Sorry, we're not supporting Apache 2.2 at this time.

      Actually, with the new authoriztion modules in Apache 2.2, there's a question as to whether there is even a need for this module in future releases.

       
      • Troy Vitullo
        Troy Vitullo
        2006-11-18

        I already replied somewhere else, but I'll make my opinion known here as well. Considering that Apache's authorization modules don't interoperate with MySQL without a recompile of apr-utils, there is definitely still space for your module. Until the apache people get their heads out of their arses and think seriously about interoperability, mod_auth_mysql will continue to fill a very important need for a lot of people.

         
    • AxeMan-YVR
      AxeMan-YVR
      2007-10-31

      Solution to mod_auth_mysql.c:591: errors

      mod_auth_mysql.c uses APR_XtOffsetOf( ) which is deprecated.

      See http://apr.apache.org/docs/apr/0.9/group__apr__general.html

      I replaced it with APR_OFFSETOF( ) and the errors disappeared.

       
    • Anindra
      Anindra
      2009-03-25

      It compiles with apache 2.2.

      1. Follow above instructions to replace APR_XtOffsetOf with APR_OFFSETOF.
      2. Compile with apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
      3. Install with apxs -i mod_auth_mysql.la

       
      • Imran Chaudhry
        Imran Chaudhry
        2009-03-25

        Just FYI, it is now in Lenny (was omitted in Etch) and therefore maintained.

        libapache2-mod-auth-mysql - Apache 2 module for MySQL authentication

        Apache 2 only. We have upgraded Apache from 1.3.

        I'm using it in production, works brilliantly and has maby hash options including (most importantly for me) - compatibility the the Apache MD5 crypt format as used in htpasswd and basic auth.