I am trying to write a c++ program for Windows that will use pigpio to stream data to a SPI device connected to a raspberry pi. I have already made a working Python version using this library and now want to remake it in c++. I am inexperienced with c++ and CMake so I could be missing something obvious, but I can't seem to get the pigpio library to compile. I haven't been able to find any directions on the internet on installing pigpio for Windows, but it seems that it should be able to work on Windows as the Python wrapper worked without problems.
Trying to build the project using CMake after downloading it results in a large number of errors that seem to vary every time I try. I have tried using both the Visual Studio and MinGW toolchains in CLion.
In my own project I have tried adding: #target_include_directories(piScreenTestC PRIVATE ${PIGPIO_DIR})
to the CMakeLists.txt which allows CLion to find the libraries and removes syntax errors, but it still fails to build. I then tried copying the pigpio files into my project and referring directly to those (i.e. with #include "lib/pigpio-master/pigpiod_if2.h"
), but this too fails to build.
The latest errors just say undefined reference to 'x'
where x is just a reference to some pigpio function. What seems weird to me is that CLion doesn't show any syntax errors, but building the project always fails. Any help with this (even just some suggestions of useful resources to learning how this stuff all works) would be appreciated.