Skip to content

error: expected unqualified-id before &' token #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dancingmirrors opened this issue May 7, 2025 · 3 comments
Open

error: expected unqualified-id before &' token #108

dancingmirrors opened this issue May 7, 2025 · 3 comments

Comments

@dancingmirrors
Copy link

I'm trying to build on FreeBSD and am hitting this:

[ 49%] Building CXX object CMakeFiles/libloot_internals_tests.dir/src/api/api.cpp.o
In file included from /home/xxx/src/libloot/src/api/metadata/yaml/plugin_metadata.h:40,
                 from /home/xxx/src/libloot/src/api/api_database.cpp:32:
/home/xxx/src/libloot/src/api/metadata/yaml/message.h: In static member function 'static bool YAML::convert<loot::Message>::decode(const YAML::Node&, loot::Message&)':
/home/xxx/src/libloot/src/api/metadata/yaml/message.h:144:41: error: expected unqualified-id before  &' token
  144 |         } catch (const fmt::format_error& e) {
      |                                         ^
/home/xxx/src/libloot/src/api/metadata/yaml/message.h:144:41: error: expected ')' before '&' token
/home/xxx/src/libloot/src/api/metadata/yaml/message.h:144:17: note: to match this '('
  144 |         } catch (const fmt::format_error& e) {
      |                 ^
/home/xxx/src/libloot/src/api/metadata/yaml/message.h:144:41: error: expected '{' before '&' token
  144 |         } catch (const fmt::format_error& e) {
      |                                         ^
/home/xxx/src/libloot/src/api/metadata/yaml/message.h:144:43: error: 'e' was not declared in this scope
  144 |         } catch (const fmt::format_error& e) {
      |                                           ^

I also tried with -DCMAKE_DISABLE_FIND_PACKAGE_yaml-cpp=ON, clang 18.1.6, and GCC 13.

@Ortham
Copy link
Member

Ortham commented May 7, 2025

My guess is that there's a missing include, try adding #include <fmt/format.h> to the top of yaml/message.h.

@dancingmirrors
Copy link
Author

Thank you! That fixed the error. The build almost completes now, still investigating.

@dancingmirrors
Copy link
Author

For some reason my installed fmt doesn't have base.h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants