0

I'm on Windows with 64bit Python 2.7

I downloaded hunspell and pyhunspell.

Using 64bit MinGW system I successfully compiled hunspell project - resulting in working executable hunspell tools and hunspell library. After the build this is my folder structure:

+---hunspell-0.1
\---hunspell-1.3.3
    +---intl
    +---m4
    +---man
    |   \---hu
    +---po
    +---src
    |   +---hunspell
    |   |   +---.deps
    |   |   \---.libs
    |   +---parsers
    |   |   +---.deps
    |   |   \---.libs
    |   +---tools
    |   |   +---.deps
    |   |   \---.libs
    |   \---win_api
    \---tests
        \---suggestiontest

In folder hunspell-0.1 I have pyhunspell project. I opened setup.py file and changed it like this:

main = Extension('hunspell',
                 libraries = ['../hunspell-1.3.3/src/hunspell/.libs/hunspell-1.3'],
                 include_dirs = ['../hunspell-1.3.3/src/hunspell'],
                 sources = ['hunspell.c'],
                 extra_compile_args = ['-Wall'])

Executing python setup.py build -c mingw32 results in this: build log ending with error message:

c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-mingw_helpers.o): bad reloc address 0x0 in section ".pdata"'

Any ideas what might be the problem?

theta
  • 24,593
  • 37
  • 119
  • 159

1 Answers1

0

I made Python package in a strange way:

  1. Changed already changed setup.py with this line:

    libraries = ['../hunspell-1.3.3/src/hunspell/.libs/libhunspell-1.3']

  2. Renamed

    hunspell-1.3.3/src/hunspell/.libs/libhunspell-1.3.dll.a

    to

    hunspell-1.3.3/src/hunspell/.libs/libhunspell-1.3.lib

  3. Compile with default compiler - MSVC:

    python setup.py build

    python setup.py install

  4. Copy

    hunspell-1.3.3/src/hunspell/.libs/libhunspell-1.3-0.dll

    to site-packages.

Import.

theta
  • 24,593
  • 37
  • 119
  • 159