I am guessing that when you install libqt5charts5 you are getting only the runtime libraries.

You probably also need to install the development files: libqt5charts5-dev