Skip to content

Fix build error: explicitly include <cstring> for std::strlen#24

Closed
tsaito-fam wants to merge 1 commit into
yosh-matsuda:mainfrom
tsaito-fam:bugfix/include-cstring
Closed

Fix build error: explicitly include <cstring> for std::strlen#24
tsaito-fam wants to merge 1 commit into
yosh-matsuda:mainfrom
tsaito-fam:bugfix/include-cstring

Conversation

@tsaito-fam

Copy link
Copy Markdown
Contributor

When building with the latest versions of fmt and nameof, the following compiler error occurs:

error: no member named 'strlen' in namespace 'std'; did you mean simply 'strlen'?
[build]  3762 |             return read(str, std::strlen(str), read_flag);
[build]       |                              ^~~~~~~~~~~
[build]       |                              strlen
[build] /usr/include/string.h:439:15: note: 'strlen' declared here
[build]   439 | extern size_t strlen (const char *__s)

This appears to be caused by one of the transitive dependencies no longer including <cstring>, so std::strlen is no longer available in the current translation unit.

This change adds an explicit #include <cstring> to resolve the issue.

@yosh-matsuda

Copy link
Copy Markdown
Owner

@tsaito-fam Thank you for your contribution. This fix has been included in v0.7.0.

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

Successfully merging this pull request may close these issues.

2 participants