LINK : fatal error LNK1158: cannot run 'rc.exe'

jonathan.underwood's Avatar

jonathan.underwood

16 Jan, 2021 09:29 PM

I am trying to use AppVeyor to build and publish 32 bit and 64 bit Python wheels for Windows. This was working well until recently when I decided to add building of Python 3.9 wheels. Because Python 3.9 is only available in the "Visual Studio 2019" image, I have specified that image in my appveyor.yaml.

Switching to this image is now resulting in my builds failing with LINK : fatal error LNK1158: cannot run 'rc.exe' - see here for an example failed build. The corresponding appveyor.yaml file is available here.

Does anyone have any pointers to how I can fix this? I rarely have to use Windows, so my knowledge is limited on that platform.

  1. Support Staff 1 Posted by Feodor Fitsner on 16 Jan, 2021 11:08 PM

    Feodor Fitsner's Avatar
  2. 2 Posted by jonathan.underw... on 16 Jan, 2021 11:34 PM

    jonathan.underwood's Avatar

    Well - those files don't exist at the same path as mentioned in that solution, and other ones like it. I could go hunting for those files in the image i suppose, but I wonder why they're not already on the PATH.

  3. 3 Posted by jonathan.underw... on 17 Jan, 2021 12:06 AM

    jonathan.underwood's Avatar

    So, based on one of the suggestions in the stackoverflow, I added this:

      # Set up the build/compiler/linker environment
      - cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 8.1
    

    which seems to fix the problem and ensures the linker is found. However, I should probably be using some environment variable rather than hardcoding the "x64". But, some progress.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac