From 49b1fca998847612d7099a5c42bb1688b7f3d226 Mon Sep 17 00:00:00 2001 From: Polaris Date: Sat, 12 Nov 2022 16:16:58 +0800 Subject: [PATCH] Fix Debug runtime error Under the win32 platform. Under the win32 platform and debug, python cannot find the matplotlib package normally. It is recommended that the debug definition include python.h is not applicable in this case. --- matplotlibcpp.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/matplotlibcpp.h b/matplotlibcpp.h index d95d46a..2f3abdd 100644 --- a/matplotlibcpp.h +++ b/matplotlibcpp.h @@ -2,7 +2,15 @@ // Python headers must be included before any system headers, since // they define _POSIX_C_SOURCE +// Under the win32 platform and debug, python cannot find the matplotlib package +// normally. It is recommended that the debug definition include python.h is not applicable in this case. +#ifdef _DEBUG && defined(MS_WIN32) +#undef _DEBUG #include +#define _DEBUG +#else +#include +#endif #include #include