swftools icon indicating copy to clipboard operation
swftools copied to clipboard

Compilation fails on Pop!_OS (Ubuntu) 21.04 - quantize.c: undefined reference to 'bitpressure_strategy1'

Open unilock opened this issue 2 years ago • 1 comments

As the title says.

lsb_release -a:

Distributor ID:	Pop
Description:	Pop!_OS 21.04
Release:	21.04
Codename:	hirsute

uname -a:

Linux stratosphere 5.13.0-7620-generic #20~1634827117~21.04~874b071-Ubuntu SMP Fri Oct 29 15:06:55 UTC  x86_64 x86_64 x86_64 GNU/Linux

Relevant bit of make:

gcc -DHAVE_CONFIG_H swfdump.o -o swfdump ../lib/librfxswf.a ../lib/libbase.a -L/usr/local/lib -lz -lm 
/usr/bin/ld: ../lib/librfxswf.a(quantize.o): in function `VBR_iteration_loop':
quantize.c:(.text+0x2a4f): undefined reference to `bitpressure_strategy1'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:75: wav2swf] Error 1
make[1]: *** Waiting for unfinished jobs....
debug enabled, not stripping swfcombine
debug enabled, not stripping swfstrings
debug enabled, not stripping swfdump
make[1]: Leaving directory '/home/unilock/Projects/swftools/src'
make: *** [Makefile:18: all] Error 2
[stratosphere:~/Projects/swftools] unilock$

Full configure + make log.

Installing lame didn't help, nor did running configure with --disable-lame, nor did running both configure and make with DISABLE_LAME=yes.

Let me know what you think.

(BTW: jpexs-decompiler worked for what I was trying to do - extract an image from a SWF file (well, export a frame, really))

unilock avatar Nov 05 '21 16:11 unilock

As a work-around, this might work for you. In ./lib/lame/quantize.c, remove inline preceding void bitpressure_strategy1(. i.e. change this:

inline
void bitpressure_strategy1(

to this:

// inline
void bitpressure_strategy1(

This fixed the problem for me. I don't understand why this fixed the problem, especially since my compiler (gcc 10.2.1 on Debian) is fine with inline preceding bitpressure_strategy2(.

deverac avatar Dec 16 '21 10:12 deverac