matplotlib-cpp icon indicating copy to clipboard operation
matplotlib-cpp copied to clipboard

Unable to compile

Open klargy opened this issue 5 years ago • 2 comments

I'm getting this error when I try to compile matplotlibcpp.h:177:29: error: cannot convert ‘wchar_t**’ to ‘char**’

klargy avatar Sep 09 '20 01:09 klargy

Hello, I'm not really sure about what I'm going to say, but I think it's because you use Python2 and not Python3. When I link Python2 I have this error and not with Python3 by the way.

But nevermind, you can replace the line 177 PySys_SetArgv(argc, const_cast<wchar_t **>(argv)); by those two lines: char ** argm = (char **)(argv); PySys_SetArgv(argc, argm); At least, it worked for me when using Python2.

PierreMezieres avatar Sep 12 '20 14:09 PierreMezieres

I got the same error. The readme example looks like it's supposed to link to python 2.7

g++ minimal.cpp -std=c++11 -I/usr/include/python2.7 -lpython2.7

yukkysaito avatar Oct 21 '20 15:10 yukkysaito