LoopPerfect / buckaroo-recipes

The official book of recipes for Buckaroo 📒
https://www.buckaroo.pm
MIT License
6 stars 4 forks source link

nlohmann/json #111

Closed thomassuckow closed 6 years ago

thomassuckow commented 6 years ago

nlohmann/json is configured to use an import of #include <json/json.hpp> where the documentation for the project and other package managers use #include <nlohmann/json.hpp>

nlohmann commented 6 years ago

Furthermore, the version should be updated from 2.1.1 to the current 3.1.2.

nikhedonia commented 6 years ago

updated the package. Thanks for your patience.

nlohmann commented 6 years ago

@nikhedonia Thanks a lot. But how can I use the 3.1.2 version?

I tried

buckaroo quickstart 
buckaroo install nlohmann/json

and then used the following buckaroo_example/main.cpp file:

#include <nlohmann/json.hpp>
#include <iostream>

using json = nlohmann::json;

int main()
{
    std::cout << json::meta() << std::endl;
}

But buck run :main failed with

buck run :main                               
2018-07-04 22:56:08,563 [WARNING][buck_tool.py:403] Not using buckd because watchman isn't installed.
buckaroo_example/apps/main.cpp:1:10: fatal error: 'nlohmann/json.hpp' file not found
#include <nlohmann/json.hpp>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
Build failed: Command failed with exit code 1.
stderr: buckaroo_example/apps/main.cpp:1:10: fatal error: 'nlohmann/json.hpp' file not found
#include <nlohmann/json.hpp>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
    When running <c++ preprocess_and_compile>.
    When building rule //:main#compile-main.cpp.oebadd394,default.
Parsing buck files: finished in 1.6 sec (100%)
Creating action graph: finished in 0.6 sec (100%)
Building: finished in 2.4 sec (100%) 4/5 jobs, 1 updated, 20.0% cache miss
  Total time: 4.6 sec

I would really like to have a small running example for my documentation.