#include <platformdirs.h>
in two different .cpp files. Link them together.
$grep -n . ?.cpp ; g++ ?.cpp -I platformdirs-src/include/ platformdirs-build/libplatformdirs.a
a.cpp:1:#include <platformdirs.h>
a.cpp:3:int main() {}
b.cpp:1:#include <platformdirs.h>
/usr/bin/ld: /tmp/ccYwsRvz.o:(.rodata+0x0): multiple definition of `platformdirs::version_[abi:cxx11]'; /tmp/ccfWT0g9.o:(.rodata+0x0): first defined here
/usr/bin/ld: /tmp/ccYwsRvz.o:(.rodata+0x8): multiple definition of `platformdirs::version_info'; /tmp/ccfWT0g9.o:(.rodata+0x8): first defined here
collect2: error: ld returned 1 exit status
The easiest fix for this is to make those variables not references, but rather copies of the underlying data (i.e. remove the & characters).
#include <platformdirs.h>in two different .cpp files. Link them together.
The easiest fix for this is to make those variables not references, but rather copies of the underlying data (i.e. remove the
&characters).