g0orx/wdsp

multiple definition

Closed this issue · 3 comments

Hi, when I do make. ld returns multiple definition of errors

/usr/bin/ld: amd.o: /home/vladimir/repository/cu/wdsp/RXA.h: 164: multiple definition of rxa '; linux_port.o: /home/vladimir/repository/cu/wdsp/RXA.h: 164: first defined here /usr/bin/ld: amd.o: /home/vladimir/repository/cu/wdsp/channel.h: 58: multiple definition of ch '; linux_port.o: /home/vladimir/repository/cu/wdsp/channel.h: 58: first defined here
/usr/bin/ld: amd.o: /home/vladimir/repository/cu/wdsp/analyzer.h: 140: multiple definition of pdisp '; linux_port.o: /home/vladimir/repository/cu/wdsp/analyzer.h: 140: first defined here /usr/bin/ld: amd.o: /home/vladimir/repository/cu/wdsp/TXA.h: 163: multiple definition of txa '; linux_port.o: /home/vladimir/repository/cu/wdsp/TXA.h: 163: first defined here
/usr/bin/ld: amd.o: /home/vladimir/repository/cu/wdsp/dexp.h: 93: multiple definition of pdexp '; linux_port.o: /home/vladimir/repository/cu/wdsp/dexp.h: 93: first defined here /usr/bin/ld: ammod.o: /home/vladimir/repository/cu/wdsp/channel.h: 58: multiple definition of ch '; linux_port.o: /home/vladimir/repository/cu/wdsp/channel.h: 58: first defined here
/usr/bin/ld: ammod.o: /home/vladimir/repository/cu/wdsp/TXA.h: 163: multiple definition of `txa '; linux_port.o: /home/vladimir/repository/cu/wdsp/TXA.h: 163: first defined here

etc. How to be? Thank you

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.1.0 (GCC)

g0orx commented

I am not having any problems with Ubuntu 20.04. It may be the gcc version 10.1.0 has changed something. The version on my system is 9.3.0.
Which Linux distribution are you running?

g0orx commented

I have just checked gcc 10.1.0 and it now defaults to -fno-common which is causing the problem. To fix this I need to go through the source code header files to make sure there is an extern on all declared variables. I will push an update when I have had time to make these changes.

g0orx commented

Pushed changes to to header files.