bennetthardwick / rust-obs-plugins

A safe wrapper around the OBS API, useful for creating OBS sources, filters and effects.
GNU General Public License v2.0
187 stars 34 forks source link

Compile issues with example plugins on Win64 #35

Closed sectortechadmin closed 2 years ago

sectortechadmin commented 2 years ago

cargo build --release in each example plugin folder:

   Compiling rnnoise-denoiser-filter v0.1.0 (D:\Documents\GitHub\sectorxusa\rust-obs-plugins\plugins\rnnoise-denoiser-filter)
     Running `rustc --crate-name rnnoisedenoiser --edition=2018 'plugins\rnnoise-denoiser-filter\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type cdylib --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=339930d1b925705d --out-dir 'D:\Documents\GitHub\sectorxusa\rust-obs-plugins\target\debug\deps' -C 'incremental=D:\Documents\GitHub\sectorxusa\rust-obs-plugins\target\debug\incremental' -L 'dependency=D:\Documents\GitHub\sectorxusa\rust-obs-plugins\target\debug\deps' --extern 'dasp=D:\Documents\GitHub\sectorxusa\rust-obs-plugins\target\debug\deps\libdasp-1219642a476d077a.rlib' --extern 'nnnoiseless=D:\Documents\GitHub\sectorxusa\rust-obs-plugins\target\debug\deps\libnnnoiseless-9d5ffb5565c55d5a.rlib' --extern 'obs_wrapper=D:\Documents\GitHub\sectorxusa\rust-obs-plugins\target\debug\deps\libobs_wrapper-8fa71ee893df0268.rlib'`
error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-Wl,C:\\Users\\VUWORL~1\\AppData\\Local\\Temp\\rustcUqSYgH\\list.def" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\self-contained\\dllcrt2.o" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "C:\\Users\\VUWORL~1\\AppData\\Local\\Temp\\rustcUqSYgH\\symbols.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.0.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.1.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.10.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.11.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.12.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.13.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.14.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.15.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.2.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.3.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.4.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.5.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.6.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.7.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.8.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.rnnoisedenoiser.1394d85a-cgu.9.rcgu.o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.4wj53ky7h0hllzme.rcgu.o" "-L" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps" "-L" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libdasp-4b6884bc08ed1cca.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libdasp_window-8e25f8cb6a5c94c6.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libdasp_signal-fd8417b8836d637d.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libdasp_ring_buffer-260373cb6b7d8778.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libdasp_interpolate-f29e36991327acc3.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libdasp_frame-c612b03f544336cd.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libdasp_sample-9cbcfefdfb5e616d.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libobs_wrapper-55ba980bd846e54b.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\liblog-35f8351c88c3ea1b.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libcfg_if-da9ea6a6bf534ac4.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libpaste-6c9ef8dc830bbfd6.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libobs_sys-fd62f8d7ad4f9cac.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libnnnoiseless-31b1cc0e3bf97ce3.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\librustfft-6b4c742f5c4c4a22.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libtranspose-c5d9b3d7891f0757.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libstrength_reduce-0fb02c8ff4f4c885.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libnum_integer-5ddc38726289a198.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libnum_complex-8ea011545b5505bc.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libnum_traits-8dd47518789d9cb0.rlib" "D:\\Documents\\GitHub\\SectorXUSA\\rust-obs-plugins\\target\\release\\deps\\libonce_cell-6517ca6cadbc627a.rlib" "-Wl,--start-group" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-fefff10efd686913.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-9c45725c63c0d5ed.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libobject-5e1c5cd9ff1eb7cc.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libmemchr-b6bf783b1c783d10.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libaddr2line-2241249e06c7cb40.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libgimli-03f5272f7c5d2bd2.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_demangle-8def22be308808fe.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd_detect-8931bc6a2b527206.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libhashbrown-6e27c0716ec027b4.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libminiz_oxide-c5bbe248c77f2f0b.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libadler-9148e9af213d2829.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-47941ef50057df8b.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-66b0ea2785827b9a.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcfg_if-4b65aaa3f0b095f9.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-04a1f133ddb50e5e.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-f67804e146a91ffe.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_core-a5cbd3ad9e3068dd.rlib" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-4bc25ea8e4535542.rlib" "-Wl,--end-group" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-ac0b598a973ccaf7.rlib" "-Wl,-Bdynamic" "-lobs" "-ladvapi32" "-luserenv" "-lkernel32" "-lws2_32" "-lbcrypt" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-nostartfiles" "-L" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-L" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\self-contained" "-o" "D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\rnnoisedenoiser.dll" "-Wl,--gc-sections" "-shared" "-Wl,--out-implib=D:\\Documents\\GitHub\\sectorxusa\\rust-obs-plugins\\target\\release\\deps\\librnnoisedenoiser.dll.a" "-Wl,-O1" "-nodefaultlibs" "C:\\ProgramData\\chocolatey\\lib\\rust\\tools\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: ld: cannot find -lobs

error: could not compile `rnnoise-denoiser-filter` due to previous error

Looks like I can't get it to link against lib-obs? Using rust 1.64.0 and llvm 15.0.3 via Chocolatey for reference.

bennetthardwick commented 2 years ago

Hi @sectortechadmin - how are you installing OBS at the moment? I'm testing building the examples using an OBS installed with chocolatey:

https://github.com/bennetthardwick/rust-obs-plugins/blob/13468fe084f6edc7dd223a56d8a0e7f1b77fb2ca/.github/workflows/build.yml#L87

It's possible that other versions of the OBS installer don't install the library or install the library to a different place. If you know where it is you can use the LIBOBS_PATH environment variable to point to the right place: https://github.com/bennetthardwick/rust-obs-plugins/blob/13468fe084f6edc7dd223a56d8a0e7f1b77fb2ca/obs-sys/build_win.rs#L34-L37

Hope that helps, let me know how you go!

sectortechadmin commented 2 years ago

@bennetthardwick thank you, I have it installed via choco as well. What's the preferred way to set the env variable? And could it point to the libobs folder in the obs-sys/obs git submodule?

bennetthardwick commented 2 years ago

@sectortechadmin depends on the shell you're using I suppose but you should be able to do something like LIBOBS_PATH=".." cargo build.

And could it point to the libobs folder in the obs-sys/obs git submodule?

I'm fair sure it needs to point to the compiled libobs.lib or libobs.dll file (so clue where that is on Windows). The libobs folder in the submodule contains the source files.

sectortechadmin commented 2 years ago

@sectortechadmin depends on the shell you're using I suppose but you should be able to do something like LIBOBS_PATH=".." cargo build.

And could it point to the libobs folder in the obs-sys/obs git submodule?

I'm fair sure it needs to point to the compiled libobs.lib or libobs.dll file (so clue where that is on Windows). The libobs folder in the submodule contains the source files.

Still having trouble. I already do use obs from choco but I'll try building on a fresh machine soon.

sectortechadmin commented 2 years ago

Might I be able to get any useful information looking at the Actions logs of this repo? On windows we have 3 different libobs dlls, and I tried using all three with no luck. Maybe I can try and discern where its getting the compiled libraries from in the Actions..

image

EDIT: it's builds now! thanks. i wound up reinstalling my entire build environment. i was using chocolatey's rust and rustup packages to no avail so i did a clean install using this article.

bennetthardwick commented 2 years ago

EDIT: it's builds now! thanks. i wound up reinstalling my entire build environment. i was using chocolatey's rust and rustup packages to no avail so i did a clean install using this article

Nice, glad you got it working! Sounds like something very odd was going on.