On Tue, 16 Mar 2004 22:04:37 -0600
John Kristoff <[EMAIL PROTECTED]> wrote:

> Does someone have any detailed notes about installing a current version
> of AIDE under cygwin?  mhash appears to compile OK, but the configure
> script in AIDE fails in its mhash library check.  From the config.log:
[...]
>   /[dir]/mhash-0.8.18/lib/mhash.c:664: multiple definition of `_main'

I finally got around to looking at this again and thought I would post
my solution in case any one else had a need for it.

Richard had pointed out the following in mhash.c:

  #ifdef WIN32
  WIN32DLL_DEFINE int main (void)
  {
          /* empty main function to avoid linker error (see cygwin FAQ) */
  }
  #endif

The cygwin FAQ at <http://cygwin.com/faq/faq_toc.html#TOC95> mentions a
potential problem with dynamic libraries needing this hack or that the
compiler line needs to be reordered.  I didn't have much luck with the
latter, so to solve I removed the definition and main() function from
the mhash.c source file and built mhash as follows:

  ./configure --enable-static=yes --enable-shared=no
  make

Then aide as:

  ./configure --with-extra-libs=-L/path/to/mhash-0.8.18/lib/.libs \
     --with-extra-includes=-I/path/to/mhash-0.8.18/lib
  make

A working aide.exe was the result.

John

Reply via email to