vendredi 27 février 2015

Problems with boost's shared_ptr when using yaml-cpp

I am trying to use yaml-cpp in a code but I get the following error:



yaml-cpp/0.5.1/include/yaml-cpp/node/detail/node_ref.h:47:95: erreur: use of deleted function ‘boost::shared_ptr::shared_ptr(const boost::shared_ptr&)’ void push_back(node& node, shared_memory_holder pMemory) { m_pData->push_back(node, pMemory); }



The code which leads to this error is:



#include <cstdlib>
#include <yaml-cpp/yaml.h>
int main()
{
YAML::Emitter out;
return EXIT_SUCCESS;
}


I have tried to use the last version of boost to overcome the problem but it does not seem to change anything. Here is the cmake command I used to install yaml-cpp:



cmake -D CMAKE_INSTALL_PREFIX=/usr/local/yaml-cpp/0.5.1/ -D Boost_NO_BOOST_CMAKE=TRUE -D BOOST_ROOT=/usr/local/boost/1.57.0 -D Boost_LIBRARY_DIRS=/usr/local/boost/1.57.0/lib/ -D Boost_NO_SYSTEM_PATHS=TRUE -D CMAKE_CXX_COMPILER=/usr/local/gcc/4.8.2/bin/g++ ..
make
make install


Can you help me, please?


EDIT: the problem disappears when I remove -std=c++11 flag from my compilation command line.


Aucun commentaire:

Enregistrer un commentaire