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

compilation error on clang-8 + C++17 #2759

Closed
janwilmans opened this issue May 5, 2021 · 2 comments
Closed

compilation error on clang-8 + C++17 #2759

janwilmans opened this issue May 5, 2021 · 2 comments
Labels
kind: bug state: needs more info the author of the issue needs to provide more details

Comments

@janwilmans
Copy link

janwilmans commented May 5, 2021

json.h:19799:62: error: no type named 'string_view' in namespace 'std'
                   && !std::is_same<ValueType, typename std::string_view>::value

I think an include of <string_view> is missing ? This only occurs on debian-8 + clang-8 + C++17 here.

@nlohmann
Copy link
Owner

nlohmann commented May 5, 2021

Which version are you using? The filename seems odd.

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label May 5, 2021
@janwilmans
Copy link
Author

janwilmans commented May 6, 2021

The file is just renamed, its this version, taken from the tag 3.9.1

    __ _____ _____ _____
 __|  |   __|     |   | |  JSON for Modern C++
|  |  |__   |  |  | | | |  version 3.9.1
|_____|_____|_____|_|___|  https://github.com/nlohmann/json

Licensed under the MIT License <http://opensource.org/licenses/MIT>.
SPDX-License-Identifier: MIT
Copyright (c) 2013-2019 Niels Lohmann <http://nlohmann.me>.

The reason why I got this problem it that I installed a binary distribution of clang-8 on debian-8, but apparently, if I do not explicitly specify -stdlib=libc++ it still uses the stock version of libstd++, which doesn't support C++17.

Long story short, I have a weird setup, but looking at the code, I didnt't see an include of <string_view>, I see that on head it is present (https://github.com/nlohmann/json/blob/develop/include/nlohmann/json.hpp#L77)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

2 participants