Issues compiling hunspell from source on windows

Discussion in 'Python' started by Akshay Kayastha, Jun 30, 2013.

  1. Hi I am trying to compile a python module called hunspell from the following [source](https://pypi.python.org/pypi/hunspell).

    But I get the following error message.

    C:\Users\KURO\Desktop\hunspell-0.1>setup.py install
    running install
    running build
    running build_ext
    building 'hunspell' extension
    C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -D_LINUX -I/usr/include/hunspell
    -IC:\Python27\include -IC:\Python27\PC -c hunspell.c -o build\temp.win-amd64-2.
    7\Release\hunspell.o -Wall
    writing build\temp.win-amd64-2.7\Release\hunspell.def
    C:\mingw\bin\gcc.exe -mno-cygwin -shared -s build\temp.win-amd64-2.7\Release\hun
    spell.o build\temp.win-amd64-2.7\Release\hunspell.def -LC:\Python27\libs -LC:\Py
    thon27\PCbuild\amd64 -lhunspell-1.2 -lpython27 -lmsvcr90 -o build\lib.win-amd64-
    2.7\hunspell.pyd
    c:/mingw/bin/../lib/gcc/mingw32/4.3.3/../../../../mingw32/bin/ld.exe: cannot fin
    d -lhunspell-1.2
    collect2: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

    I tried downloading libhunspell-1.2-0.dll and put it into my system. But I still get the same error message. How do I deal with this? I have Windows 7 and [mingw](http://www.develer.com/oss/GccWinBinaries)
     
    Akshay Kayastha, Jun 30, 2013
    #1
    1. Advertising

  2. Akshay Kayastha

    rusi Guest

    On Sunday, June 30, 2013 9:24:46 PM UTC+5:30, Akshay Kayastha wrote:
    > Hi I am trying to compile a python module called hunspell from the following
    > [source](https://pypi.python.org/pypi/hunspell).
    >


    According to
    http://docs.python.org/2/extending/windows.html
    you need to use the same compiler for the extension as used to compile python.

    That means one of
    1. Use the MSC version used for your python
    2. Recompile python from source using mingw
    3. Switch to linux :)
     
    rusi, Jun 30, 2013
    #2
    1. Advertising

  3. Haha... nooo I already use Linux. But I am currently doing a project that required me to run my script on Windows as well as Linux. TO be precise I amsupposed to create a stand alone executable for my script which runs greaton Linux, but to create one for Windows I need to be able to run the script first. My script runs fine on Linux as its hella easy to install the module, but on windows I cant seem to be able to get the module working :(
     
    Akshay Kayastha, Jun 30, 2013
    #3
  4. It appears you are using a 32 bit compiler with a 64-bit python.
    Install a 32 bit python.

    On Sun, Jun 30, 2013 at 11:54 AM, Akshay Kayastha <> wrote:
    > Hi I am trying to compile a python module called hunspell from the following [source](https://pypi.python.org/pypi/hunspell).
    >
    > But I get the following error message.
    >
    > C:\Users\KURO\Desktop\hunspell-0.1>setup.py install
    > running install
    > running build
    > running build_ext
    > building 'hunspell' extension
    > C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -D_LINUX -I/usr/include/hunspell
    > -IC:\Python27\include -IC:\Python27\PC -c hunspell.c -o build\temp.win-amd64-2.
    > 7\Release\hunspell.o -Wall
    > writing build\temp.win-amd64-2.7\Release\hunspell.def
    > C:\mingw\bin\gcc.exe -mno-cygwin -shared -s build\temp.win-amd64-2.7\Release\hun
    > spell.o build\temp.win-amd64-2.7\Release\hunspell.def -LC:\Python27\libs -LC:\Py
    > thon27\PCbuild\amd64 -lhunspell-1.2 -lpython27 -lmsvcr90 -o build\lib.win-amd64-
    > 2.7\hunspell.pyd
    > c:/mingw/bin/../lib/gcc/mingw32/4.3.3/../../../../mingw32/bin/ld.exe: cannot fin
    > d -lhunspell-1.2
    > collect2: ld returned 1 exit status
    > error: command 'gcc' failed with exit status 1
    >
    > I tried downloading libhunspell-1.2-0.dll and put it into my system. But I still get the same error message. How do I deal with this? I have Windows 7 and [mingw](http://www.develer.com/oss/GccWinBinaries)
    > --
    > http://mail.python.org/mailman/listinfo/python-list
     
    David Robinow, Jun 30, 2013
    #4
  5. I installed a 32 bit python and it still gives me the same error.
     
    Akshay Kayastha, Jul 1, 2013
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan
    Replies:
    2
    Views:
    432
  2. Peter Butter

    Compiling a tar.gz source file in Windows

    Peter Butter, Oct 22, 2004, in forum: C Programming
    Replies:
    4
    Views:
    3,097
    Phlip
    Oct 22, 2004
  3. Garrett Cooper
    Replies:
    0
    Views:
    557
    Garrett Cooper
    Feb 24, 2009
  4. Garrett Cooper
    Replies:
    0
    Views:
    499
    Garrett Cooper
    Feb 24, 2009
  5. Lon Baker
    Replies:
    1
    Views:
    224
    Csaba Henk
    Mar 21, 2005
Loading...

Share This Page