matplotlib-cpp
matplotlib-cpp copied to clipboard
error: redefinition of 'select_npy_type<long long>'
/Users/vagrawal/new/object_pose/include/matplotlibcpp.hpp:306:20: error: redefinition of 'select_npy_type<long long>'
template <> struct select_npy_type<long long> { const static NPY_TYPES type = NPY_INT64; };
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/vagrawal/new/object_pose/include/matplotlibcpp.hpp:297:20: note: previous definition is here
template <> struct select_npy_type<int64_t> { const static NPY_TYPES type = NPY_INT64; };
^
/Users/vagrawal/new/object_pose/include/matplotlibcpp.hpp:307:46: warning: static_assert with no message is a C++17 extension [-Wc++17-extensions]
static_assert(sizeof(unsigned long long) == 8);
^
, ""
/Users/vagrawal/new/object_pose/include/matplotlibcpp.hpp:308:20: error: redefinition of 'select_npy_type<unsigned long long>'
template <> struct select_npy_type<unsigned long long> { const static NPY_TYPES type = NPY_UINT64; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/vagrawal/new/object_pose/include/matplotlibcpp.hpp:301:20: note: previous definition is here
template <> struct select_npy_type<uint64_t> { const static NPY_TYPES type = NPY_UINT64; };
^
I'm using cmake for building. I'm working on macOS Catalina. Do you have suggestions to fix this?
if I comment out those lines and run a simple
plt::plot({1,3,2,4});
plt::show();
I get this error:
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Error loading module matplotlib.pyplot!
You need to uncomment a few lines, as noted in the code here: https://github.com/lava/matplotlib-cpp/blob/60dcd64c8fd4766e5426f57decfb765422a1d3fe/matplotlibcpp.h#L303 (I'm running on Catalina, too)
works for me (macos catalina)
Hello, I had the similar problem, but after commenting out the lines in matplotlibcpp.h. I am getting an error saying
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find : No such file or directory collect2.exe: error: ld returned 1 exit status
Any suggestions? Thank you.
Also had this issue in mingw_w64, and commenting out those lines fixed it.
@Cryoris Thx, this works for me.
Those asserts should simply be removed since those (long long
and unsigned long long
) are type aliases of fixed size types ?
I'm getting this error with a vcpkg
installation of the library with the latest MSVC
. Is it possible to update the port so that this no longer occurs?