I have a C++ project which uses a couple of c++14 features including std::make_unique.
The project compiles and runs fine and has done for a while however, now I am trying to add a python interface and I'm having some troubles.
In my python extension I try to declare my C++ class as unique using:
#include <memory>
...
typedef struct {
PyObject_HEAD
std::unique_ptr<MyClass> my_instance;
} PyMyClass;
...
self->my_instance = std::make_unique<MyClass>();
And in my setup.py
file I have included -std=c++14
as a compiler option.
It builds fine with python setup.py develop/install
but when I import the module into python I get the following error:
my_module.so: undefined symbol: _Z15build_331792650RSt10unique_ptrIN6grelka5SlaveESt14default_deleteIS1_EE
Do I need to do an extra linking step somewhere?