You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While making pullseq with gcc 10.2.0, I got the following error during linking:
...
gcc -g -O2 -o pullseq hash.o output.o size_filter.o search_header.o file_read.o pull_by_re.o pull_by_name.o pull_by_size.o pullseq.o -lpcre -lz
/usr/bin/ld: output.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: output.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here
/usr/bin/ld: output.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here /usr/bin/ld: size_filter.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here
/usr/bin/ld: size_filter.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: size_filter.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here
/usr/bin/ld: search_header.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here /usr/bin/ld: search_header.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here
/usr/bin/ld: search_header.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here /usr/bin/ld: file_read.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here
/usr/bin/ld: file_read.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: file_read.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here
/usr/bin/ld: pull_by_re.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here /usr/bin/ld: pull_by_re.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here
/usr/bin/ld: pull_by_re.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: pull_by_name.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here
/usr/bin/ld: pull_by_name.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here /usr/bin/ld: pull_by_name.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here
/usr/bin/ld: pull_by_size.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here /usr/bin/ld: pull_by_size.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here
/usr/bin/ld: pull_by_size.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: pullseq.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here
/usr/bin/ld: pullseq.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here /usr/bin/ld: pullseq.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:376: pullseq] Error 1
make[2]: Leaving directory '/home/kinestetika/bin/util/pullseq/src'
make[1]: *** [Makefile:283: all] Error 2
make[1]: Leaving directory '/home/kinestetika/bin/util/pullseq/src'
make: *** [Makefile:344: all-recursive] Error 1
The text was updated successfully, but these errors were encountered:
Modern C standards require declaration of the variables in a header (.h) file as extern <variable> and then only define the variables in one code (.c) file.
Here is a patch file that cleans this up -- the final code still needs the commented out variable deleted to make it really clean. I left them in as a learning tool for my student(s).
I have modified the patchfile, it was causing some hiccups when applying. patch -s -p0 < pullseq20230119.patch
now works flawlessly. pullseq20230119.patch
sjaenick
added a commit
to MGX-metagenomics/tools
that referenced
this issue
Jul 20, 2023
While making pullseq with gcc 10.2.0, I got the following error during linking:
...
gcc -g -O2 -o pullseq hash.o output.o size_filter.o search_header.o file_read.o pull_by_re.o pull_by_name.o pull_by_size.o pullseq.o -lpcre -lz
/usr/bin/ld: output.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of
QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: output.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of
verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here/usr/bin/ld: output.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of
progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here /usr/bin/ld: size_filter.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of
verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here/usr/bin/ld: size_filter.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of
QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: size_filter.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of
progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here/usr/bin/ld: search_header.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of
verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here /usr/bin/ld: search_header.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of
QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here/usr/bin/ld: search_header.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of
progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here /usr/bin/ld: file_read.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of
verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here/usr/bin/ld: file_read.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of
QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: file_read.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of
progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here/usr/bin/ld: pull_by_re.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of
verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here /usr/bin/ld: pull_by_re.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of
progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here/usr/bin/ld: pull_by_re.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of
QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: pull_by_name.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of
verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here/usr/bin/ld: pull_by_name.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of
progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here /usr/bin/ld: pull_by_name.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of
QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here/usr/bin/ld: pull_by_size.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of
verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here /usr/bin/ld: pull_by_size.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of
progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here/usr/bin/ld: pull_by_size.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of
QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined here /usr/bin/ld: pullseq.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: multiple definition of
progname'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:26: first defined here/usr/bin/ld: pullseq.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: multiple definition of
verbose_flag'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:28: first defined here /usr/bin/ld: pullseq.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: multiple definition of
QUALITY_SCORE'; hash.o:/home/kinestetika/bin/util/pullseq/src/global.h:27: first defined herecollect2: error: ld returned 1 exit status
make[2]: *** [Makefile:376: pullseq] Error 1
make[2]: Leaving directory '/home/kinestetika/bin/util/pullseq/src'
make[1]: *** [Makefile:283: all] Error 2
make[1]: Leaving directory '/home/kinestetika/bin/util/pullseq/src'
make: *** [Makefile:344: all-recursive] Error 1
The text was updated successfully, but these errors were encountered: