Open zeroheure opened 3 years ago
As of April 2022 this is a problem on Ubuntu 22.04
cc -std=c99 -Wall -O3 -I/opt/mozjpeg/include -o jpeg-recompress jpeg-recompress.c src/util.o src/edit.o src/smallfry.o src/iqa/build/release/libiqa.a /opt/mozjpeg/lib64/libjpeg.a -lm
/usr/bin/ld: src/util.o:(.bss+0x8): multiple definition of `VERSION'; /tmp/cc3e1HIE.o:(.bss+0x28): first defined here
/usr/bin/ld: src/util.o:(.bss+0x0): multiple definition of `progname'; /tmp/cc3e1HIE.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:42: jpeg-recompress] Error 1
GCC 10 default to -fno-common which force use of extern with global variable. This revert the flag. See https://gcc.gnu.org/gcc-10/porting_to.html
Fix #119