Skip to content
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

there are no arguments to ‘format_as’ that depend on a template parameter, so a declaration of ‘format_as’ must be available [-fpermissive] template <typename U, typename V = decltype(format_as(U())) #2578

Closed
L-Super opened this issue Dec 15, 2022 · 3 comments

Comments

@L-Super
Copy link

L-Super commented Dec 15, 2022

env:

  • Clion 2022.2.3
  • g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
  • cmake 3.25 (CMAKE_CXX_STANDARD 11)

when I use spdlog v1.11.0 on centos, I meet this error.

In file included from /home/.../include/spdlog/include/spdlog/fmt/fmt.h:27:0,
                 from /home/.../include/spdlog/include/spdlog/common.h:45,
                 from /home/.../include/spdlog/include/spdlog/spdlog.h:12,
                 from /home/.../src/cvr/http_server.cpp:8:
/home/.../include/spdlog/include/spdlog/fmt/bundled/core.h:1334:60: error: there are no arguments to ‘format_as’ that depend on a template parameter, so a declaration of ‘format_as’ must be available [-fpermissive]
   template <typename U, typename V = decltype(format_as(U())),
                                                            ^
/home/.../include/spdlog/include/spdlog/fmt/bundled/core.h:1334:60: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/Listening/MonitorStorageServer/include/spdlog/include/spdlog/fmt/bundled/core.h:1334:60: error: there are no arguments to ‘format_as’ that depend on a template parameter, so a declaration of ‘format_as’ must be available [-fpermissive]

I found the same problem on the fmt library.link: 2969

Normally, the problem should have been fixed, but I still encountered this error.I don't know what's wrong

@L-Super
Copy link
Author

L-Super commented Dec 15, 2022

By the way, when I use version spdlog v1.10.0, it can compile successfully

@tt4g
Copy link
Contributor

tt4g commented Dec 15, 2022

Since spdlog v1.11.0, fmt v9 is now bundled, so there are incompatible changes.
I assume you are using a feature that is no longer supported in src/cvr/http_server.cpp:8 shown in the error message.

Note GCC4.8 may not work because the C++11 standard is not complete. This is a compiler issue (https://stackoverflow.com/a/36970437).

@L-Super
Copy link
Author

L-Super commented Dec 16, 2022

OK, thank you! The compiler is too old maybe

@L-Super L-Super closed this as completed Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants