davidmoreno / rtpmidid

RTP MIDI (AppleMIDI) daemon for Linux
Other
178 stars 39 forks source link

Install issue "`GLIBCXX_3.4.26' not found" (with possible solution) #79

Closed r10kindsofpeople closed 7 months ago

r10kindsofpeople commented 2 years ago

From a fully updated Ubuntu 18.04, I got the error shown when running rtpmidid installed from rtpmidid_21.11.2.g0edef_amd64.deb and corresponding lib packages.

Based on Google searches, I:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt upgrade

and that pulled in a newer version of libstdc++.so.6 and the software runs.

r10kindsofpeople commented 2 years ago

Are you interested in other "first time build" dependency issues? Hint: {fmt} https://github.com/fmtlib/fmt

r10kindsofpeople commented 2 years ago

Keeping this all in one thread so it's easier to ignore if I'm really a crackpot, but... Am I gathering correctly that to use the library in a project, {fmt} must be linked in, and to link in {fmt} properly, I have to be using c++20 ==> g++-10 ? Without it, I was getting unresolved linker errors with fmt functions, I went to their web page, saw "Implementation of C++20 std::format" on their list. Installed g++-10, and the linker errors went away, although now its complaining during compile that 'args#0' is not a constant expression when including exceptions.hpp.

If all this is misguided, then please ignore (although I'd love someone to tell me where exactly I went off the mark), but if it's true, this is a serious impediment to using the library for embedded projects. As is, it's added 6 hours of frustration that seem to all point to {fmt}.

davidmoreno commented 2 years ago

Hi,

as you may have guesses I programmed rtpmidid with a later ubuntu version. I dont think I use anything specially c++20. For libfmt, try installing libfmt-dev, or at worst, compile and install manyally from https://github.com/fmtlib/fmt .

If the problem is just the linker problems, try manually linking it, and if that works, modify as needed the cmake file. I had problems with linking on some older raspberry OS and had to do some changes sometimes.

To try to add it manually, what I do is "make VERBOSE=1", see where the link is taking place, copy and paste, and modify as needed (normally add -lfmt or a -L/path/to/fmt).

If it does not work, tell me and I will try to install a VM and compile it.

r10kindsofpeople commented 2 years ago

TLDR; my advice is to build librtpmidid from source and link to that, not the .deb packaged library.

I tried to repeat using different steps, and I now think that the issue is with the version of fmt, not gcc. Linking against the packaged librtpmidid0-dev_21.11.2.g0edef_amd64.deb yields lots of: '/usr/lib/librtpmidid.so: undefined reference to `int fmt::v6::internal::snprintf_float(long double, int, fmt::v6::internal::float_specs, fmt::v6::internal::buffer&)' But if I build librtpmidi from the source, no linker errors when I link to it with my test program. The only libfmt I could find online was for 8.0.0 and later.

davidmoreno commented 2 years ago

Hi, I did some manual changes to the main CMakeLists.txt and I could make it compile on ubuntu 18.04:

  1. Ensure have libfmt and other deps installed: sudo apt install g++ libavahi-client-dev libfmt-dev git cmake
  2. Comment the line: pkg_check_modules(FMT REQUIRED fmt)
  3. Under it, add the line set(FMT_LIBRARIES -lfmt)

I could compile and use it. I dont want to do the commit straight to master, as it's better to use pkg_check_modules. I will try to look some conditional login in the CMakeFiles.txt file to try first one, and if not available, do the other.