Skip to content

Linking against pythonXX.lib fails on windows within virtualenv #213

@striggldy

Description

@striggldy

When a virtualenv (created with the venv or virtualenv module, pyvenv not tested) is active, building on windows fails with fatal error LNK1181, because the pythonXX.lib cannot be found.

In

} else if cfg!(target_os = "windows") {
println!("cargo:rustc-link-search=native={}\\libs", exec_prefix);

the rustc lib search path {exec_prefix}/libs will be added, which is valid for a system interpreter, but not for virtualenvs created with the modules mentioned above. There's no LIBDIR set as well when running python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR')"

Is there a way to specifiy additional link search paths for rust_cpython?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions