Closed r10kindsofpeople closed 7 months ago
Are you interested in other "first time build" dependency issues? Hint: {fmt} https://github.com/fmtlib/fmt
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}.
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.
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
Hi, I did some manual changes to the main CMakeLists.txt and I could make it compile on ubuntu 18.04:
sudo apt install g++ libavahi-client-dev libfmt-dev git cmake
pkg_check_modules(FMT REQUIRED fmt)
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.
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:
and that pulled in a newer version of libstdc++.so.6 and the software runs.