56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
# JSON_SKIP_LIBRARY_VERSION_CHECK
|
|
|
|
```cpp
|
|
#define JSON_SKIP_LIBRARY_VERSION_CHECK
|
|
```
|
|
|
|
When defined, the library will not create a compiler warning when a different version of the library was already
|
|
included.
|
|
|
|
## Default definition
|
|
|
|
By default, the macro is not defined.
|
|
|
|
```cpp
|
|
#undef JSON_SKIP_LIBRARY_VERSION_CHECK
|
|
```
|
|
|
|
## Notes
|
|
|
|
!!! danger "ABI compatibility"
|
|
|
|
Mixing different library versions in the same code can be a problem as the different versions may not be ABI
|
|
compatible.
|
|
|
|
## Examples
|
|
|
|
??? example "Example: switch off the version check"
|
|
|
|
The code below switches off the warning about including a different version of the library.
|
|
|
|
```cpp
|
|
#define JSON_SKIP_LIBRARY_VERSION_CHECK 1
|
|
#include <nlohmann/json.hpp>
|
|
|
|
...
|
|
```
|
|
|
|
??? example "Example: warning about a different library version"
|
|
|
|
The following warning will be shown in case a different version of the library was already included:
|
|
|
|
```
|
|
Already included a different version of the library!
|
|
```
|
|
|
|
## See also
|
|
|
|
- [`NLOHMANN_JSON_VERSION_MAJOR` / `NLOHMANN_JSON_VERSION_MINOR` /
|
|
`NLOHMANN_JSON_VERSION_PATCH`](nlohmann_json_version_major.md) - library version information
|
|
- [Supported Macros](../../features/macros.md) - guide to all supported macros
|
|
- [Integration](../../integration/index.md) - integrate the library
|
|
|
|
## Version history
|
|
|
|
- Added in version 3.11.0.
|