matplotlib-cpp
matplotlib-cpp copied to clipboard
Error in 1st example
When I run the standard minimal example
#include "inc/matplotlibcpp.h"
namespace plt = matplotlibcpp;
int main() {
plt::plot({1,3,2,4});
plt::show();
}
I receive a memory access error. Output: the plot shows up and I receive the error message "Memory access error (memory dump written)".

I compiled the program using
g++ -std=c++11 -W -o test test.cpp -I/home/username/anaconda3/include/python3.7m/ -I/home/username/anaconda3/lib/python3.7/site-packages/numpy/core/include -L/home/username/anaconda3/lib/ -lpython3.7m
as described in the docs
You are not including the dynamic library for python.
g++ -std=c++11 -Wall -o test test.cpp -I /usr/include/python3.10 -I /home/ai/.local/lib/python3.10/site-packages/numpy/core/include /usr/lib/x86_64-linux-gnu/libpython3.10.so