Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error with GCC 10 #84

Closed
lmarz opened this issue Apr 17, 2020 · 2 comments
Closed

Compilation error with GCC 10 #84

lmarz opened this issue Apr 17, 2020 · 2 comments

Comments

@lmarz
Copy link

lmarz commented Apr 17, 2020

The program returns a linking error with GCC 10

gcc-10 -pthread -Wall -Wno-unknown-pragmas -g -O2   -o pixz pixz-common.o pixz-cpu.o pixz-endian.o pixz-list.o pixz-pixz.o pixz-read.o pixz-write.o -lm -larchive -llzma  -lm 
/usr/bin/ld: pixz-list.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:58: multiple definition of `gStream'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:58: first defined here
/usr/bin/ld: pixz-list.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: multiple definition of `gOutFile'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: first defined here
/usr/bin/ld: pixz-list.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: multiple definition of `gInFile'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: first defined here
/usr/bin/ld: pixz-pixz.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: multiple definition of `gInFile'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: first defined here
/usr/bin/ld: pixz-pixz.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: multiple definition of `gOutFile'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: first defined here
/usr/bin/ld: pixz-pixz.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:58: multiple definition of `gStream'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:58: first defined here
/usr/bin/ld: pixz-read.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: multiple definition of `gOutFile'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: first defined here
/usr/bin/ld: pixz-read.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: multiple definition of `gInFile'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: first defined here
/usr/bin/ld: pixz-read.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:58: multiple definition of `gStream'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:58: first defined here
/usr/bin/ld: pixz-write.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: multiple definition of `gInFile'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: first defined here
/usr/bin/ld: pixz-write.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:58: multiple definition of `gStream'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:58: first defined here
/usr/bin/ld: pixz-write.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: multiple definition of `gOutFile'; pixz-common.o:/home/leon/Downloads/pixz-1.0.6/src/pixz.h:57: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:407: pixz] Error 1
make[2]: Leaving directory '/home/leon/Downloads/pixz-1.0.6/src'
make[1]: *** [Makefile:376: all-recursive] Error 1
make[1]: Leaving directory '/home/leon/Downloads/pixz-1.0.6'
make: *** [Makefile:317: all] Error 2

The problem exists because of some missing extern definition for global variables in pixz.h. It can be fixed with the help of the Porting Guide
There is also a Debian Bug Report addressing this issue: #957689

@vasi
Copy link
Owner

vasi commented Apr 25, 2020

Thanks for the report, it should be fixed in master. Can you please test?

@lmarz
Copy link
Author

lmarz commented Apr 26, 2020

It compiled successfully. Thank you very much

@lmarz lmarz closed this as completed Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants