According to the Cython documentation ,I write the following cython code as follows:
In [1]:%load_ext Cython In [2]: %%cython from libcpp.vector c
You need to tell cython that you are compiling C++ and not C, through the special comment
cython
C++
C
# distutils: language = c++
adding this after the %%cython block will fix your problem.
%%cython