Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load module as it's linked with 14.34, but the core is linked with 14.29 #229

Open
JoyceBabu opened this issue Feb 9, 2023 · 2 comments

Comments

@JoyceBabu
Copy link
Contributor

JoyceBabu commented Feb 9, 2023

I am trying to build an extension for windows using the same GitHub workflow used by this project. But PHP is refusing to load the module due to linker version difference. I tried using PHP 8.1 and 8.2, from windows.php.net, which are both compiled with VS 16.

I am using rust-lld as my linker as suggested under Windows Requirements.

@fuyedong
Copy link

  1. 安装编译工具

    打开 Visual Studio Installer 使用
    修改 -> 单个组件 -> 搜索 2019 -> 选中 "MSVC v142-VS 2019 C++ x64/x86 生成工具(v14.29-16.11)" -> 右下角 "修改" -> 完成生成工具的安装

  2. 在项目中配置编译工具

    在项目中新增 .cargo/config.toml 文件, 添加以下内容

    [target.x86_64-pc-windows-msvc]
    rustflags = ["-C", "link-arg=/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x64"]
    linker = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\Hostx64\\x64\\link.exe"

    路径与你的安装路径保持一致, 以上是默认安装路径

  3. 编译

    cargo build
    

@fuyedong
Copy link

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants