lava / matplotlib-cpp

Extremely simple yet powerful header-only C++ plotting library built on the popular matplotlib
MIT License
4.36k stars 1.13k forks source link

Multiple definition issue #362

Open Helyousfi opened 1 month ago

Helyousfi commented 1 month ago

Thanks for this project, I got this issue, I installed Python2.7

Build started... 1>------ Build started: Project: Utils, Configuration: Debug x64 ------ 1>graph_plotter.cpp 1>Matplotlib\matplotlib-cpp\matplotlibcpp.h(354,10): error C2766: explicit specialization; 'matplotlibcpp::detail::select_npy_type' has already been defined 1>Matplotlib\matplotlib-cpp\matplotlibcpp.h(345,10): message : see previous definition of 'select_npy_type<__int64>' 1>Matplotlib\matplotlib-cpp\matplotlibcpp.h(356,10): error C2766: explicit specialization; 'matplotlibcpp::detail::select_npy_type' has already been defined 1>Matplotlib\matplotlib-cpp\matplotlibcpp.h(349,10): message : see previous definition of 'select_npy_type' 1>Done building project "Utils.vcxproj" -- FAILED. 2>------ Build started: Project: GraphLibrary, Configuration: Debug x64 ------ 2>GraphLibrary.vcxproj -> x64\Debug\GraphLibrary.exe ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Build started at 6:55 PM and took 03,723 seconds ==========

Helyousfi commented 1 month ago

Solved it by commenting the lines in matplotlibcpp.h ile template <> struct select_npy_type { const static NPY_TYPES type = NPY_INT64; }; template <> struct select_npy_type { const static NPY_TYPES type = NPY_UINT64; };