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

Use the newest version of fmt may occurr error #338

Closed
ghost opened this issue Mar 3, 2022 · 4 comments
Closed

Use the newest version of fmt may occurr error #338

ghost opened this issue Mar 3, 2022 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 3, 2022

It may occurr errors about fmt when I use the newest version of fmt (8.1.1) to build project.
Errors as following (a part):

...
/usr/local/include/fmt/core.h:1699:3: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
   static_assert(
...
/usr/local/include/fmt/core.h:1699:3: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
...
/usr/local/include/fmt/format.h:1068:4: error: use of ‘fmt::v8::detail::count_digits(UInt)::<lambda(UInt)> [with int BITS = 4; UInt = unsigned int]’ before deduction of ‘auto’
   return [](UInt m) {
          ~~~~~~~~~~~~
     int num_digits = 0;
     ~~~~~~~~~~~~~~~~~~~
     do {
     ~~~~
       ++num_digits;
       ~~~~~~~~~~~~~
     } while ((m >>= BITS) != 0);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     return num_digits;
     ~~~~~~~~~~~~~~~~~~
   }(n);
...
/usr/local/include/fmt/format.h:1068:4: error: use of ‘fmt::v8::detail::count_digits(UInt)::<lambda(UInt)> [with int BITS = 1; UInt = unsigned int]’ before deduction of ‘auto’
...
/usr/local/include/fmt/format.h:1068:4: error: use of ‘fmt::v8::detail::count_digits(UInt)::<lambda(UInt)> [with int BITS = 3; UInt = unsigned int]’ before deduction of ‘auto’
...
/usr/local/include/fmt/format.h:1068:4: error: use of ‘fmt::v8::detail::count_digits(UInt)::<lambda(UInt)> [with int BITS = 4; UInt = long unsigned int]’ before deduction of ‘auto’
...

You might get other errors about fmt.
Try use old version of fmt to rebuild Sophus, I built successful with fmt 8.0.0.
OS: Ubuntu 18.04.6 LTS
Compiler: g++

@NikolausDemmel
Copy link
Contributor

So what's the error? Which OS and compiler?

@cwg968
Copy link

cwg968 commented Mar 21, 2022

i absolutely agree with you, because i recently met the same situation. @Jiajie-Shi

@NikolausDemmel
Copy link
Contributor

NikolausDemmel commented Mar 21, 2022

Sophus compiles fine on macOS with AppleClang with fmt 8.1.1, so it might be an issue related to older GCC. I suggest checking which GCC version is affected and maybe trying to come up with a minimal reproducible example to possibly raise this issue over at libfmt.

@YonatanSimson
Copy link

OS: Ubuntu 18.04.6 LTS
Installing fmt package solved the issue for me:
sudo apt-get install -y libfmt-dev

kaikai23 referenced this issue in kaikai23/pyceres Jun 6, 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

4 participants