Upgrading v0.8 to v0.9¶
Updating the Code¶
v0.9 includes a major overhaul of the C++ API for creating values. If you haven't already been using a git version from sometime in the last two/three months, this is going to break any C++ code from previous versions. Sorry, but it's worth it and not that hard to get working again. Basically you need to change from this:
object env = create_object();
to be this instead:
object env = create< object >();
Similarly for array, string, natives etc. This new create api is much more powerful -- and too much to go into here, check out the docs for it : <http://flusspferd.org/docs/group__create.html#ga4330a9ba851b6f11a49654bcec110d6a> (there will be a more permanent url when 0.9 is released)
Updating the CFlags¶
If when compiling you get an error like this:
/usr/local/include/flusspferd/create/native_object.hpp:95: error: wrong number of template arguments (6, should be 5) /usr/local/include/boost/parameter/parameters.hpp:714: error: provided for ‘template<class PS0, class PS1, class PS2, class PS3, class PS4> struct boost::parameter::parameters’
It means you are missing a define, namely: -DBOOST_PARAMETER_MAX_ARITY=10 The pkg-config file has these changes, and if you are just compiling a plugin module (rather than embedding flusspferd itself) We've made it easier for you. Simply create a CMakeLists.txt in your module root, and have it contain something like this:
cmake_minimum_required(VERSION 2.6.4)
execute_process( COMMAND flusspferd --cmake OUTPUT_VARIABLE hippo_cmake)
include("${hippo_cmake}")
if(NOT CMAKE_BUILD_TYPE)
set( CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
FILE(GLOB_RECURSE sources
"${CMAKE_SOURCE_DIR}/src/*.cpp"
"${CMAKE_SOURCE_DIR}/src/*.hpp")
add_definitions("-Wall")
flusspferd_plugin(
"zest"
SOURCES ${sources})
Other things you can pass to "flusspferd_plugin" are:
- JS - js files to install along with native module
- LIBRARIES - libraries to use at link time; and
- DEFINITIONS - C++ definitions to define at compile time.
If you have any problems that aren't described above, or any of the fixes dont work, come grab us on irc://irc.freenode.net/#flusspferd or on the mailing list http://groups.google.com/group/flusspferd.