#Has anyone been able to target msvc abi from Linux

1 messages · Page 1 of 1 (latest)

vale comet
#

Seems like there are a lot of issues when targetting msvc abi.

I get the following error with

(.venv) kira@pop-os:/mnt/secondary-ssd/Kira_GitProjects/PythonProjects/CPython_Extentions$ zig build -p src --prefix-lib-dir src/cpython_extensions -Dtarget=x86_64-windows-msvc
zig build-lib spam Debug x86_64-windows-msvc: error: error(compilation): clang failed with stderr: In file included from /mnt/secondary-ssd/Kira_GitProjects/PythonProjects/CPython_Extentions/src/cpython_extensions/spammodule.c:2:
/home/kira/.local/share/pyenv/versions/3.11.7/include/python3.11/Python.h:23:12: fatal error: 'stdlib.h' file not found

Wondering if I missed a step or it can't be done on non-windows os

fervent lark
#

zig doesn't ship with msvc headers or libc files, so you'll need to provide an msvc installation; in general it isn't supported but technically you could make it work

vale comet
#

is it legal issue that prevents zig from doing this?

fervent lark
#

primarily

vale comet
#

crap. I was hoping at least zig would be able to do this doom

delicate birch
#

zig is capable of this, you just need to provide the libc headers yourself

vale comet
#

hmm. how do I do that?

delicate birch
#

download them, then point to them in a custom libc file

vale comet
#

flush bro

#

where can I download msvc on linux?

delicate birch
#

how do you think cargo-xwin does it?

#

it downloads it from microsoft

vale comet
#

ngl I don't know how it works. Is there a guide on it?

delicate birch
#

i'd look at cargo-xwin's code

vale comet
#

I don't know rust couldn't really make much sense out of it

delicate birch
#

you can install the headers on windows through the visual studio installer and then copy them to linux