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

Can't run successfully for visual studio 2019 and 2022. #280

Open v-xiacli opened 2 years ago

v-xiacli commented 2 years ago

1.Can't find the Specify a build system generator. solution: delete the folder matplotlib-cpp-master\CMakeFiles cmake -G "Visual Studio 16 2019" -DPYTHONHOME:STRING=%PYTHONHOME% -DCMAKE_BUILD_TYPE:STRING=%CMAKE_CONFIG%

  1. Can't find the Cmakelists.txt Copy winbuild to the parent folder.

  2. Linker error of python https://github.com/Microsoft/caffe/issues/76 add the path of python39.lib install numpy scipy matplotlib in python

GordonEldest commented 2 years ago

Work fine for me (MSVC2019), Don't really remember what I did with CMake but surely nothing complex I hate CMake.

I did NOT modify any files (aside later as raised in issue #285 ), but rather enhance the project once CMake did it's dark magic

1- Put "python37.lib" (the version I use as MSV does propose for it) in the Linker->Input->additional Dependencies, in order to alleviate any issue with Debug/Release lib;. (I link Debug code with release lib, not even sure if there is a debug lib) Option find the Release lib and copy/rename to pythonxx_d.lib.

2- I installed Python from MSVC install and setup Path to it BEFORE running CMAKE. I didn't use a vanillia external install. And here the include to be found or set in project Properties-> C++->General $(ProgramFiles(x86)\Microsoft Visual Studio\Shared\Python37_64\include\;

Work for me, the code work fine and worth some effort. but, yes, I don't have complex related dependencies like pycaffe. However I don't "feel" your issue related to that