Update:
Solved the issue was probably related to installing ROOT with the snap package manager, I solved this by using the pre-compiled binaries instead, I also made a switch from an Ubunto enviroment in WSL to a Debian one, but i don’t think that this is related, I might test this in the following days as I started getting similar issues on my Laptop as well and will probably try this fix while staying on Ubuntu.
Original Post:
Hello to everyone.
I was able to use ROOT on my desktop WSL installation until earlier today when i suddenly got this compiler error.
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32'
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `strlcpy@GLIBC_2.38'
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `arc4random_buf@GLIBC_2.36'
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `strlcat@GLIBC_2.38'
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `__isoc23_strtol@GLIBC_2.38'
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `__isoc23_strtoull@GLIBC_2.38'
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `__isoc23_sscanf@GLIBC_2.38'
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `fmod@GLIBC_2.38'
/usr/bin/ld: /snap/root-framework/943/usr/local/lib/libCore.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_cold(char*, unsigned long, char const*, unsigned long, unsigned long)@GLIBCXX_3.4.31'
from what i gathered online (as I am currently just a university studend with a limited coding background) there seems to be an issue with linking root and some standard c++ libraries but i am not sure how to fix this.
This same error appears while also recompiling code that was previously compiled on the same machine without errors.
the way i usually compile is simply:
g++ -o name name.cc `root-config --cflags` `root-config --libs`
and this still works on the laptop i am currently using as a replacement.
I know that this may be a generic error and not necessarly ROOT related, but I decidied to still post on this forum to make sure.
Thanks in advance for the eventual help.
ROOT Version: 6.34.02
Platform: WSL
Compiler: g++