Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#include <chaiscript/chaiscript.hpp>
#include <chaiscript/chaiscript_stdlib.hpp>
std::string helloWorld(const std::string &t_name)
return "Hello " + t_name + "!";
int main()
chaiscript::ChaiScript chai(chaiscript::Std_Lib::library());
chai.add(chaiscript::fun(&helloWorld), "helloWorld");

This comment has been minimized.

Copy link

@totalgee totalgee commented Feb 10, 2017

Looks like this example need to be updated... The latest version of ChaiScript doesn't work with this usage. I think you'd need to replace ChaiScript with ChaiScript_Basic, in order for the first argument to still be the Std_Lib::library() (e.g. if you want to compile the standard library in a separate file). It seems you've changed the default ChaiScript constructor to create Std_Lib by default, rather than searching for an external library at runtime, as mentioned here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.