vlc-rs icon indicating copy to clipboard operation
vlc-rs copied to clipboard

LINK : fatal error LNK1181: cannot open input file 'vlc.lib'

Open tuaris opened this issue 4 years ago • 7 comments

Using the instruction on README.md. I added to the bottom of Cargo.toml

[dependencies]
vlc-rs = "0.3"

Then copy pasted the example to main.rs. Build on Windows fails with:

LINK : fatal error LNK1181: cannot open input file 'vlc.lib'

I do have VLC installed

tuaris avatar Jun 27 '20 01:06 tuaris

@tuaris I've forked this repo and changed it to use dynamic loading instead of static linking: https://github.com/fschutt/vlc-static-rs

The vlc.lib doesn't exist on Windows, so I just loaded the functions from the libvlc.dll and libvlccore.dll from the 3.0.11 release, downloaded from the VLC installation. In order for vlc-static-rs to work, you can clone the repo and run cargo run --example test -- "mymovie.mp4". Plus you need to copy the /plugins directory (where are the video codecs are) from C:\Program Files\VideoLan\VLC to vlc-static-rs/target/debug/examples. Then it'll run on Windows, too, otherwise you'll just get an initialization error when running the example.

fschutt avatar Jul 30 '20 16:07 fschutt

@tuaris I've forked this repo and changed it to use dynamic loading instead of static linking: https://github.com/fschutt/vlc-static-rs

The vlc.lib doesn't exist on Windows, so I just loaded the functions from the libvlc.dll and libvlccore.dll from the 3.0.11 release, downloaded from the VLC installation. In order for vlc-static-rs to work, you can clone the repo and run cargo run --example test -- "mymovie.mp4". Plus you need to copy the /plugins directory (where are the video codecs are) from C:\Program Files\VideoLan\VLC to vlc-static-rs/target/debug/examples. Then it'll run on Windows, too, otherwise you'll just get an initialization error when running the example.

How would this work in regards to our own custom scripting. for instance would i just move the plugins directory or would i need to do more as well?

PDFergus avatar Oct 13 '22 18:10 PDFergus

@PDFergus you just bundle everything your plugins inside of the app and use include_bytes!() to package it into the final binary. Then you unpack it when the user starts the application.

fschutt avatar Oct 14 '22 04:10 fschutt

Any fix for this?

prayag17 avatar Apr 18 '23 07:04 prayag17

@prayag17 yeah, use vlc-static-rs instead of vlc-rs, because the former includes the vlc.lib file as part of the distribution

fschutt avatar Apr 18 '23 10:04 fschutt

I found vlc.lib, it is present inside the SDK folder. But I am having other issues when running it

prayag17 avatar Apr 18 '23 11:04 prayag17

vlc-rs uses vs to export .lib from .dll. The code in crates.io failed to work. I use it directly from git:

[dependencies.vlc-rs]
git = "https://code.videolan.org/videolan/vlc-rs.git"

It just works for me!

felixmaker avatar May 12 '23 08:05 felixmaker