Log in

View Full Version : Compiling a plugin for Linux


Couleur
11th April 2022, 20:16
Hey, this is one of the only places I've thought of to ask for help about this, I've been trying to compile this:

https://github.com/f0e/vs-frameblender

This is a modified version of AverageFrames which allows for 128 weights (instead of 31), the owner has gone inactive and only ever released DLLs. I've tried using g++ and Visual Studio Code with that weird Linux WSL port, but nothing worked, some guy told me there might be a way using the .vcxproj, but I'm no cpp expert, I'd really appreciate having some experienced eyes take a look at these solutions/this project!

PS: While using it on Windows I notice this is much slower at averaging frames on newer versions of VapourSynth, anything newer than R54 is awfully slow for a reason I ignore, let me know if you find the reason why

Edit: My G++ version is 11.2.0

cretindesalpes
11th April 2022, 20:42
You can compile the plug-in this way from the command line:
g++ -shared -std=c++17 -O3 -Ivs-frameblender/vapoursynth vs-frameblender/main.cpp
You’ll probably have to rename the output file, but I’m not sure about the naming convention on vapoursynth/linux. Maybe linux gurus here could give you a better answer.

Couleur
11th April 2022, 20:48
This command gives me the following error:

/usr/sbin/ld: /tmp/cc9yaWV7.o: warning: relocation against `_ZTISt13runtime_error@@GLIBCXX_3.4' in read-only section `.text.unlikely'
/usr/sbin/ld: /tmp/cc9yaWV7.o: relocation R_X86_64_PC32 against symbol `_ZTISt13runtime_error@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/sbin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

Adding -fPIC gives me a.out, not sure what to do with this though

PS: Tried to compile a.out to a .so and got the following error (if that even matters):

/usr/sbin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status

Update: that command makes it compiles just fine on Windows, it might be directly related to the plugin then.. ��

Couleur
13th April 2022, 14:05
update: using clang++ instead of g++ worked out