uowuo/abaddon

Build Error - Multiple Definitions in Notifier Class

Closed this issue · 1 comments

Hi!

I am currently attempting to build the latest version of the project on Linux, and I've encountered a build error related to multiple definitions in the Notifier class. The error output is as follows:

[100%] Linking CXX executable abaddon
/usr/bin/ld: CMakeFiles/abaddon.dir/src/notifications/notifier_gio.cpp.o: in function `Notifier::Notifier()':
notifier_gio.cpp:(.text+0x0): multiple definition of `Notifier::Notifier()'; CMakeFiles/abaddon.dir/src/notifications/notifier_fallback.cpp.o:notifier_fallback.cpp:(.text+0x0): first defined here
/usr/bin/ld: CMakeFiles/abaddon.dir/src/notifications/notifier_gio.cpp.o: in function `Notifier::Notifier()':
notifier_gio.cpp:(.text+0x0): multiple definition of `Notifier::Notifier()'; CMakeFiles/abaddon.dir/src/notifications/notifier_fallback.cpp.o:notifier_fallback.cpp:(.text+0x0): first defined here
/usr/bin/ld: CMakeFiles/abaddon.dir/src/notifications/notifier_gio.cpp.o: in function `Notifier::~Notifier()':
notifier_gio.cpp:(.text+0x40): multiple definition of `Notifier::~Notifier()'; CMakeFiles/abaddon.dir/src/notifications/notifier_fallback.cpp.o:notifier_fallback.cpp:(.text+0x40): first defined here
/usr/bin/ld: CMakeFiles/abaddon.dir/src/notifications/notifier_gio.cpp.o: in function `Notifier::~Notifier()':
notifier_gio.cpp:(.text+0x40): multiple definition of `Notifier::~Notifier()'; CMakeFiles/abaddon.dir/src/notifications/notifier_fallback.cpp.o:notifier_fallback.cpp:(.text+0x40): first defined here
/usr/bin/ld: CMakeFiles/abaddon.dir/src/notifications/notifier_gio.cpp.o: in function `Notifier::Withdraw(Glib::ustring const&)':
notifier_gio.cpp:(.text+0x60): multiple definition of `Notifier::Withdraw(Glib::ustring const&)'; CMakeFiles/abaddon.dir/src/notifications/notifier_fallback.cpp.o:notifier_fallback.cpp:(.text+0x60): first defined here
/usr/bin/ld: CMakeFiles/abaddon.dir/src/notifications/notifier_gio.cpp.o: in function `Notifier::Notify(Glib::ustring const&, Glib::ustring const&, Glib::ustring const&, Glib::ustring const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
notifier_gio.cpp:(.text+0xe0): multiple definition of `Notifier::Notify(Glib::ustring const&, Glib::ustring const&, Glib::ustring const&, Glib::ustring const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'; CMakeFiles/abaddon.dir/src/notifications/notifier_fallback.cpp.o:notifier_fallback.cpp:(.text+0x70): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/abaddon.dir/build.make:1705: abaddon] Error 1
make[1]: *** [CMakeFiles/Makefile2:122: CMakeFiles/abaddon.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
make: Leaving directory '/home/javi/.cache/paru/clone/abaddon-git/src/build'

I saw that CMakeLists.txt should handle this but it seems it is not working:

if (NOT WIN32)
    target_sources(abaddon PRIVATE src/notifications/notifier_gio.cpp)
else ()
    target_sources(abaddon PRIVATE src/notifications/notifier_fallback.cpp)
endif ()

Do you think it could be a problem from my side? Thank you in advance!

Do you think it could be a problem from my side? Thank you in advance!

nope i was just a bit of a dummy