Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

redefinitions in ebr.hpp #1247

Open
lukaszstolarczuk opened this issue Apr 5, 2022 · 0 comments
Open

redefinitions in ebr.hpp #1247

lukaszstolarczuk opened this issue Apr 5, 2022 · 0 comments
Labels
radix_tree Needs to be resolved to productize radix_tree Type: Bug Something isn't working

Comments

@lukaszstolarczuk
Copy link
Member

As seen e.g. in pmemkv (1.4+) build:

/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::ebr()':
/usr/include/libpmemobj++/detail/ebr.hpp:121: multiple definition of `pmem::detail::ebr::ebr()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:121: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::ebr()':
/usr/include/libpmemobj++/detail/ebr.hpp:121: multiple definition of `pmem::detail::ebr::ebr()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:121: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::register_worker()':
/usr/include/libpmemobj++/detail/ebr.hpp:141: multiple definition of `pmem::detail::ebr::register_worker()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:141: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::worker::worker(pmem::detail::ebr*, std::reference_wrapper<std::atomic<unsigned long> >)':
/usr/include/libpmemobj++/detail/ebr.hpp:239: multiple definition of `pmem::detail::ebr::worker::worker(pmem::detail::ebr*, std::reference_wrapper<std::atomic<unsigned long> >)'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:239: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::sync()':
/usr/include/libpmemobj++/detail/ebr.hpp:166: multiple definition of `pmem::detail::ebr::sync()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:166: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::full_sync()':
/usr/include/libpmemobj++/detail/ebr.hpp:196: multiple definition of `pmem::detail::ebr::full_sync()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:196: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::staging_epoch()':
/usr/include/libpmemobj++/detail/ebr.hpp:215: multiple definition of `pmem::detail::ebr::staging_epoch()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:215: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::gc_epoch()':
/usr/include/libpmemobj++/detail/ebr.hpp:232: multiple definition of `pmem::detail::ebr::gc_epoch()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:232: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::worker::worker(pmem::detail::ebr*, std::reference_wrapper<std::atomic<unsigned long> >)':
/usr/include/libpmemobj++/detail/ebr.hpp:239: multiple definition of `pmem::detail::ebr::worker::worker(pmem::detail::ebr*, std::reference_wrapper<std::atomic<unsigned long> >)'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:239: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::worker::~worker()':
/usr/include/libpmemobj++/detail/ebr.hpp:250: multiple definition of `pmem::detail::ebr::worker::~worker()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:250: first defined here
/usr/bin/ld: CMakeFiles/pmemkv.dir/src/engines-experimental/radix.cc.o: in function `pmem::detail::ebr::worker::~worker()':
/usr/include/libpmemobj++/detail/ebr.hpp:250: multiple definition of `pmem::detail::ebr::worker::~worker()'; CMakeFiles/pmemkv.dir/src/engine.cc.o:/usr/include/libpmemobj++/detail/ebr.hpp:250: first defined here
collect2: error: ld returned 1 exit status

// copy-pasted from https://github.com/lukaszstolarczuk/pmemkv/runs/5831415476?check_suite_focus=true

it's most likely the fault of missing static inline for all (public?) classes/functions (as seen in the log above) in ebr.hpp

It should be fixed in the latest branch containing this code.

@lukaszstolarczuk lukaszstolarczuk added Type: Bug Something isn't working radix_tree Needs to be resolved to productize radix_tree labels Apr 5, 2022
lukaszstolarczuk added a commit to lukaszstolarczuk/libpmemobj-cpp that referenced this issue Aug 22, 2022
to avoid "multiple definition" compiler issue.

Fixes: pmem#1247
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
radix_tree Needs to be resolved to productize radix_tree Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant