danielgtaylor / jpeg-archive

Utilities for archiving JPEGs for long term storage.
1.16k stars 121 forks source link

workaround for GCC 10 #121

Open zeroheure opened 3 years ago

zeroheure commented 3 years ago

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

gdarko commented 2 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