linking fails on Dragonboard 410c with multiple definitions
jpelletier opened this issue · comments
version.c.o multiple definition of `gVERSION'
mraa.c.o first defined here
The file version.c is generated automatically and is conflicting with the existing definition in mraa.c.
Anybody knows how to fix this?
When the code is cloned on a raspberrypi, it works fine.
With these modifications, it linked successfully.
In include/version.h, I commented these lines
const char *gVERSION;
const char *gVERSION_SHORT;
and copied these lines in src/mraa.c
Hi @jpelletier,
Have you tried disabling the tests (BUILDTESTS
option)? This might be caused by trying to build with missing dependencies:
Take a look at the CMakeLists.txt file.
did u find any fix @jpelletier?
did u find any fix @jpelletier?
See Propanu's comments. When disabling the tests, it works.
@jpelletier Thank you for the hint.
I solved the issue by specifying the two constants as extern
, as the version.h header file only sets their declaration. The version.c source file provides their values.
extern const char* gVERSION;
extern const char* gVERSION_SHORT;
For an unknown reason, git clone https://github.com/nrcrast/mraa.git
provides the version.h header file without extern
while the code on repository does include extern
.
Lines 14 to 15 in d7ae171
Can we backport this fix to the latest release?