lava / matplotlib-cpp

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

Unable to compile #225

Open klargy opened 3 years ago

klargy commented 3 years ago

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

PierreMezieres commented 3 years ago

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.

yukkysaito commented 3 years ago

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