vlc-rs 0.3.0 can't link to 'vlc.lib' (3.0.17.4) on windows

This forum is about all development around libVLC.
Turbo_Slowpoke
New Cone
New Cone
Posts: 2
Joined: 31 Jul 2022 07:20

vlc-rs 0.3.0 can't link to 'vlc.lib' (3.0.17.4) on windows

Postby Turbo_Slowpoke » 31 Jul 2022 07:40

Hello,

I'm trying to compile the example from the vlc-rs package and I'm facing this issue:

Code: Select all

x86_64-pc-windows-msvc\lib\vlc.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x12
According to this guide https://code.videolan.org/videolan/vlc-rs, all I need to do is to set the env variables which should point to the 'vlc.lib' which comes from the 'sdk' directory if you download the *.zip package (installer doesn't have the 'sdk' directory at all). Setting VLC_LIB_DIR didn't work for me actually, so I've put vlc.lib directly into the toolchain lib dir like so:

Code: Select all

.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\vlc.lib
I there anything else I need to do? Seems like linker is having some troubles...

Turbo_Slowpoke
New Cone
New Cone
Posts: 2
Joined: 31 Jul 2022 07:20

Re: vlc-rs 0.3.0 can't link to 'vlc.lib' (3.0.17.4) on windows

Postby Turbo_Slowpoke » 02 Aug 2022 14:01

Okay, so I made it work. Apparently, my linker didn't like vlc.lib, so I duplicated libvlc and renamed it into vlc.lib.
I also had to add support for legacy stdio definitions:

build.rs:

Code: Select all

fn main() { println!("cargo:rustc-link-lib=dylib=legacy_stdio_definitions"); }


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 35 guests