Skip to main content.
home | support | download

Back to List Archive

Windows app

From: <Kerry.Thurber(at)not-real.signalsolutionsinc.com>
Date: Fri Dec 05 2003 - 20:24:08 GMT
Thanks to David Norris, I was able to build the swish-e library and header
files for Windows.  I'm trying to build a COM object with the library, and
I came up with more issues than I could wrap my head around, so I backed up
and and started building a simple console app.  Here's the code:

#include <stdio.h>   /*Apparently needed for swish-e.h */
#include <string.h>
#include "swish-e.h"

int main(int argc, char **argv)
{
      char *index;
      index=strdup("E:\\base\\index.ndx");
      SW_HANDLE sh;
      /* sh=SwishInit(index); */
      return 0;
}

This compiles fine, but if I uncomment the SwishInit line I get a link
error:

"error LNK2019:  unresolved external symbol _SwishInit referenced in
function _main"

Now I can see SwishInit defined in the header file, and also the source
from the library project is shown below.

Being that SW_HANDLE is defined as (void *) in the header file, this all
looks good to me, and I don't understand the error.

Can anybody help me?

SWISH  *SwishInit(char *indexfiles)
{
    StringList *sl = NULL;
    SWISH  *sw;
    int     i;

    sw = SwishNew();
    if (!indexfiles || !*indexfiles)
    {
        set_progerr(INDEX_FILE_ERROR, sw, "No index file supplied" );
        return sw;
    }


    /* Parse out index files, and append to indexlist */
    sl = parse_line(indexfiles);

    if ( 0 == sl->n )
    {
        set_progerr(INDEX_FILE_ERROR, sw, "No index file supplied" );
        return sw;
    }



    for (i = 0; i < sl->n; i++)
        addindexfile(sw, sl->word[i]);

    if (sl)
        freeStringList(sl);

    if ( !sw->lasterror )
        SwishAttach(sw);

    return sw;
}
Received on Fri Dec 5 20:24:20 2003