-
Notifications
You must be signed in to change notification settings - Fork 5
Setup guide
To use the library, you first have to download this repository and add the header files inside Cereal/Cereal
to your project. You should have the following items:
Cereal.h
src/Array.h
src/Buffer.h
src/Database.h
src/Field.h
src/Header.h
src/Internal.h
src/Object.h
src/Reader.h
src/Writer.h
Then, you need to link those file into your project. The next sections will describe the specific setup for G++/Clang and for Microsoft Visual Studio.
For G++/Clang, you only need to add the header files into the include search path of your program. This is done using the -I
parameter as follows: -Irelative/path/to/Cereal
. Also remember to add the -std=c++11
parameter to the command, because Cereal uses C++11 and if this parameter is not present, the compilation will fail.
An example compilation command could look as follows:
marcizhu@linux:~/project $ g++ main.cpp -Iinclude/ -Wall -O2 -std=c++11 -o output_file
Finally, you'll only need to include Cereal.h
and start using it.
For Visual Studio, open the project settings and go to the Project paths page. There, inside Include paths, and the path to Cereal.
Once all those files are linked to your project, now you only have to include Cereal.h
and start using it! All the clases are inside the namespace Cereal
, so you might consider adding a using namespace Cereal;
on the top of your code.
Pretty simple, right?
Home | About Cereal | Setup Guide | Technical Docs | API Reference | Copyright © 2016 - 2019 The Cereal Team