First you should be able to build LibreCAD from source. There is a wiki article about it on
https://wiki.librecad.org/When you have successfully build LibreCAD and are able to run your own build application you're ready to start with plugin.
Go to the plugins folder in LibreCAD source, there is everything you need.
Examine an existing plugin, e.g.
sample plugin and understand how it works.
Then copy a plugin which is similar to that you want to write and work on that copy.
Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution