tokenizers icon indicating copy to clipboard operation
tokenizers copied to clipboard

LNK1112 Error on Windows

Open Mansterteddy opened this issue 6 years ago • 6 comments

Hi,

I can build python binding on Ubuntu, however, when I want to build python binding on Windows, I always met this error: fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86', I have changed the toolchain from nightly to nightly-2019-11-01, but it doesn't work. Do you have any idea?

Best Wishes!

Mansterteddy avatar Feb 11 '20 03:02 Mansterteddy

What is your process to compile on windows? Did you run cargo build?

n1t0 avatar Feb 11 '20 04:02 n1t0

Thanks for your reply! On Windows, I run cargo build under tokenizers folder, it works well. But when I run python setup.py install under python folder, it outputs above error.

Mansterteddy avatar Feb 11 '20 05:02 Mansterteddy

Hi @Mansterteddy ,

Do you observe the same error by running pip install . from the python folder ?

mfuntowicz avatar Feb 11 '20 13:02 mfuntowicz

Hi @mfuntowicz ,

Thanks for your reply! Yes, I observe the same error: fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' error: cargo failed with code: 101

pip install . outputs another line: ERROR: Could not build wheels for tokenizers which use PEP 517 and cannot be installed directly

Do you have any idea?

Best Wishes!

Mansterteddy avatar Feb 12 '20 09:02 Mansterteddy

I just got the same problem while trying to build for Python 32-bit on windows. I was able to fix it by making sure that both Python and the selected Rust toolchain matched:

  • If you build for a python 32-bit version you should use rust nightly-i686-pc-windows-msvc.
  • For python 64-bit you should use rust nightly-x86_64-pc-windows-msvc

Let me know how it goes!

n1t0 avatar Feb 25 '20 23:02 n1t0

It works, thanks a lot!

Mansterteddy avatar Feb 26 '20 11:02 Mansterteddy