【问题标题】:What json.hpp to use for mac什么 json.hpp 用于 mac
【发布时间】:2018-01-27 12:04:48
【问题描述】:

我正在做一个编程任务,它需要我读取一个 json 文件。为此,我使用https://github.com/nlohmann/json。当我#include "json.hpp" 我得到错误。我猜这是因为我需要为 Mac 正确编码。但我不知道该怎么做!任何人都可以帮助我吗?

Here is an image of my compiler ouput

【问题讨论】:

    标签: c++ json macos


    【解决方案1】:

    该库是用 C++11 编写的(根据文档)。

    默认情况下,您的编译器不使用 C++11。要修复它需要这样的东西:

    g++ -std=c++11 ...
    

    如果它抱怨-std=c++11 无效,请尝试-std=c++0x(已过时的同义词)。

    【讨论】:

    • 非常感谢!! :) 这解决了它!
    猜你喜欢
    • 2018-11-02
    • 1970-01-01
    • 2015-12-30
    • 1970-01-01
    • 2011-09-08
    • 1970-01-01
    • 2015-03-08
    • 2012-12-28
    • 1970-01-01
    相关资源
    最近更新 更多