garkimasera / vlc-rs

Rust bindings for libVLC media framework.
MIT License
66 stars 18 forks source link

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

Open tuaris opened 4 years ago

tuaris commented 4 years ago

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

fschutt commented 4 years ago

@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.

PDFergus commented 2 years ago

@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?

fschutt commented 2 years ago

@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.

prayag17 commented 1 year ago

Any fix for this?

fschutt commented 1 year ago

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

prayag17 commented 1 year ago

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

felixmaker commented 1 year ago

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!