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

ostream.h does not have FMT_EXPORT #3617

Closed
maths644311798 opened this issue Aug 31, 2023 · 1 comment
Closed

ostream.h does not have FMT_EXPORT #3617

maths644311798 opened this issue Aug 31, 2023 · 1 comment
Labels

Comments

@maths644311798
Copy link

maths644311798 commented Aug 31, 2023

I use gcc 13 and cmake 3.27.0 to compile a project with standard C++20. It shows the following errors:

/usr/local/include/fmt/ostream.h:158:1: error: 'FMT_EXPORT' does not name a type
158 | FMT_EXPORT template
| ^~~~~~~~~~
/usr/local/include/fmt/ostream.h:177:1: error: 'FMT_EXPORT' does not name a type
177 | FMT_EXPORT template <typename... T>
| ^~~~~~~~~~
/usr/local/include/fmt/ostream.h:186:1: error: 'FMT_EXPORT' does not name a type
186 | FMT_EXPORT
| ^~~~~~~~~~
/usr/local/include/fmt/ostream.h:194:1: error: 'FMT_EXPORT' does not name a type
194 | FMT_EXPORT template <typename... T>
| ^~~~~~~~~~
/usr/local/include/fmt/ostream.h:199:1: error: 'FMT_EXPORT' does not name a type
199 | FMT_EXPORT

I know that FMT_EXPORT is in fmt.cc. But I don't know why the compiler can not find it. The linking sentence in CMakeLists.txt is

target_link_libraries(${PROJECT_NAME} fmt)

It seems that this problem comes with another library spdlog. See gabime/spdlog#2872 (comment)

@vitaut
Copy link
Contributor

vitaut commented Aug 31, 2023

FMT_EXPORT is defined here:

# define FMT_EXPORT

Most likely you are including incompatible versions of {fmt} headers (part from spdlog and part from elsewhere).

@vitaut vitaut closed this as completed Aug 31, 2023
@vitaut vitaut added the invalid label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants