none
Python (for ARM) build error : LNK1112 RRS feed

  • Question

  • I tried to build python for ARM from binary to use on Windows IoT core on Raspberry pi 3 model B. Referenced page below:

    https://docs.microsoft.com/ja-jp/windows/iot-core/developer-tools/python

    *sorry for showing Japanese page URL, couldn't find English page URL

    Build process of python for x86 successfully finished (by command without options "PCbuild\build.bat"), but the command with option ("PCbuild\build.bat -p ARM --no-tkinter") failed with linker error LNK1112 so python for ARM couldn't be build.

    <Error message>

    C:\Users\<username>\Desktop\cpython\PCbuild\obj\38arm32_Release\pythoncore\_abc.obj : fatal error LNK1112:  module machine type 'x86' conflicts with target machine type 'ARM'. [C:\Users\<username>\Desktop\cpython\PCbuild\pythoncore.vcxproj]

    My environment is Windows 10 Enterprise 64bit, Visual studio 2017 community with python native development tools.

    Best regards.

    Friday, November 15, 2019 3:00 AM

Answers

  • Hello Rokko2Massy,

    I built the projects with Visual Studio 2017 Enterprise Version 15.9.7. You may try to upgrade the Visual Studio. In addition, you may check if you have install the libraries in Visual Studio for ARM.

    Best Regards,

    Michael


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Rokko2Massy Tuesday, November 19, 2019 1:28 PM
    Tuesday, November 19, 2019 1:42 AM
    Moderator

All replies

  • Hello Rokko2Massy,

    I have confirmed that, with following the doc, python can be built successfully and woks fine on Raspberry Pi 3.

    You need to check if the same version of Python was installed to run PC/layout, in the document, the target is python 3.8. I removed all the python versions on my PC, and installed 3.8.

    BTW, my Windows IoT Core is build 17763.107.

    Best Regards,

    Michael


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 18, 2019 3:17 AM
    Moderator
  • Hello Michael,

    Thank you very much for replying. I'm grad to hear you have successfully build python for ARM in your environment.

    I confirmed the python version in my PC and it was 3.7.5, so I updated it to 3.8.0. But when I tried to build again I encountered the same Error (LNK1112).

    The Error occurs during building of python for ARM, in compiling source files.

    <---commands--->

    git clone https://github.com/python/cpython →Success
    cd cpython →Success
    git checkout 3.8 →Success
    pcbuild\build.bat -p ARM --no-tkinter →Failed with LNK1112

    pcbuild\build.bat →Not reached here yet
    pcbuild\win32\python.exe PC/layout -vv -s "." -b ".\PCBuild\arm32" -t ".\PCBuild\temp" --preset-iot --include-venv --zip ".\PCBuild\arm32\zip\python.zip" →Not reached here yet


    I suppose this problem isn't due to version conflict of python, but because of setting .vcproj file etc. I appreciate it if you have any idea for solving this.

    Thank you and Best Regards,

    Monday, November 18, 2019 12:21 PM
  • Hello Rokko2Massy,

    I built the projects with Visual Studio 2017 Enterprise Version 15.9.7. You may try to upgrade the Visual Studio. In addition, you may check if you have install the libraries in Visual Studio for ARM.

    Best Regards,

    Michael


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Rokko2Massy Tuesday, November 19, 2019 1:28 PM
    Tuesday, November 19, 2019 1:42 AM
    Moderator
  • What are the next steps?

    Is there <g class="gr_ gr_10 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="10" id="10">anyway</g> we can get <g class="gr_ gr_8 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="8" id="8">numpy</g> or <g class="gr_ gr_9 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="9" id="9">scipy</g> to work also?

    Has anyone tried building a fresh UWP native python library from binary, and setting string var etc/

    And then ...

    Tuesday, November 19, 2019 2:12 AM
  • Hello Michael,

    I installed additional workloads you suggested and tried again. Finally python for ARM is successfully build!

    Thank you so much, you were great help for me.

    Best Regards,

    Tuesday, November 19, 2019 1:28 PM