importing boost library

I am trying to import the boost library. I go to sketch->include library-> boost. It inserts two lines at the top:

#include <predef.h>
#include <regex.h>

I then run my code.
The error I get is this:

In file included from C:\Users\user\Documents\Arduino\ultrasonic\ultrasonic.ino:1:0:

C:\Users\user\Documents\Arduino\libraries\boost/predef.h:13:35: fatal error: boost/predef/language.h: No such file or directory

 #include <boost/predef/language.h>
compilation terminated.

Using library boost in folder: C:\Users\user\Documents\Arduino\libraries\boost (legacy)

It would help to know where to find the 'boost' library.

Because the library is described as "(legacy)" I think it is not in the current format and may not be entirely compatible with the latest version of Arduino. Do you have a file named C:\Users\user\Documents\Arduino\libraries\boost\predef\language.h?

I believe this is the library I am looking for:

And yes, there is a language.h file at that location.

Java use import. C and C++ do not. Make it look somewhat like you know what you are talking about by using the correct terminology.

The problem is that library was apparently written for a different system of includes. Instead of:

#include <boost/predef/language.h>

The Arduino IDE doesn’t work like that, it should be:

#include <predef/language.h>

actually most correct would be:

#include "predef/language.h"

but the angle brackets will work.
You can fix this by doing a search and replace of:

#include <boost/


#include <

on all files in the library (there are over 51000 occurrences!). Then do a search and replace of

#   include <boost/


#   include <

After that, compiling for Uno I encountered another compile error:

E:\Stuff\misc\electronics\arduino\libraries\boost/predef/detail/_cassert.h:12:19: fatal error: cassert: No such file or directory

 #include <cassert>

but maybe this would work for a different architecture.

I suspect you might be better off telling us what you’re actually trying to accomplish.

Sure! I am trying to retrieve JSON data, then parse through it.

Why do you want to use the Boost library? Which board are you using?

I was following a tutorial, and saw that they included boost at the top, which led me to this. I have no preference. I just want to use the easiest way to get/parse json data. I am using the arduino uno.

I have no experience with using JSON with Arduino but I do know there's a library named ArduinoJson:

You can install it by:

  • Sketch > Include Library > Manage Libraries
  • Wait for download to complete
  • Type "arduinojson" in the "Filter your search..." box
  • Click on the "ArduinoJson" entry
  • Click "Install"
  • Wait for installation to complete
  • Click "Close"

You will find some usage examples at File > Examples > ArduinoJson.