davidmoreno / rtpmidid

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

can't compile without enabling precompiled headers #112

Open sadguitarius opened 4 months ago

sadguitarius commented 4 months ago

Hi @davidmoreno, on the most recent commit I'm only able to get rtpmidid to compile by enabling precompiled headers. While this isn't necessarily a showstopper, I figured I'd bring it up. I'm running Manjaro ARM on the unstable branch, so I should be generally up to date as far as packages go (fmt v10 not v9), but there must be some discrepancy between my setup and yours. Is this something you've run into at all? It generally seems to be related to logging functions and libfmt, especially ones that are parsing JSON text. If you need to see error messages, I can try recompiling with precompiled headers off to see what it spits out, but it was mainly just a bunch of incomprehensibly long template errors. Thank you!

sadguitarius commented 3 months ago

Ok I've managed to get the build to work by changing std::string_view to fmt::string_view in all the fmt calls as well as converting some of the json output to std::string so that it doesn't mess up the logger calls. I don't know enough about the fmt library to understand exactly why this fixes anything and I can't say how much of my changes are actually necessary until I go back and try restoring some of the original code to see where things start to break. I'm also not sure whether this breaks anything with fmt v9 or other distros. Is there anything you'd like me to send over so you can check it out?

davidmoreno commented 3 months ago

Maybe the pull request just to see what changes in your code. But don't worry too much.

I will try to compile without PCH in a manjaro container, and hopefully I will get the same errors.

Anyway my plan is to star t using C++20 with std::format, so no need (hopefully) for libfmt. But will not work on older distros. For those an older version of rtpmidid will still work.

Thanks for the report.

sadguitarius commented 3 months ago

Ok cool, I sent over a PR just in case it's helpful. Thank you!