Multiple definition errors when linking on arch using gcc 10.1.0
by Andy Alt from LinuxQuestions.org on (#53K9F)
Someone opened an issue reporting "multiple definition" errors when building on arch. I was able to reproduce the problem after updating an arch docker image locally (gcc 10.1.0 was the default after the update).
Here's part of the log:
Quote:
I have this at the top of rmw.h, which in the past has prevented such problems:
Code:#ifndef _INC_RMW_H
#define _INC_RMW_HIt builds on other distros, and built on arch before I updated (which I hadn't done for over six months).
Here is a successful build log on Ubuntu Bionic that ran 27 days ago (no code changes since then).


Here's part of the log:
Quote:
Making all in src make[1]: Entering directory '/home/murali/Downloads/rmw/build/src' make all-am make[2]: Entering directory '/home/murali/Downloads/rmw/build/src' CCLD rmw /bin/ld: rmw-restore_rmw.o:/home/murali/Downloads/rmw/build/src/../../src/rmw.h:95: multiple definition of verbose'; rmw-main.o:/home/murali/Downloads/rmw/build/src/../../src/rmw.h:95: first defined here /bin/ld: rmw-config_rmw.o:/home/murali/Downloads/rmw/build/src/../../src/rmw.h:95: multiple definition of verbose'; rmw-main.o:/home/murali/Downloads/rmw/build/src/../../src/rmw.h:95: first defined here |
Code:#ifndef _INC_RMW_H
#define _INC_RMW_HIt builds on other distros, and built on arch before I updated (which I hadn't done for over six months).
Here is a successful build log on Ubuntu Bionic that ran 27 days ago (no code changes since then).