Hello and thank you for the formatting attempt on the pasted code… however can you use the method as described in the Welcome Topic, as the “built in” </> doesn’t always display correctly. (I have already edited your post, so you can go back and see how it is done). Thank you.
Can you paste the exact error here (as shown in the CLI) as that can sometimes point out the area of the syntax?
Also, it appears you are using the WiringPi C++ method with your RPi, correct? If so, it appears you are missing all the libraries, and void()
structure and, well, everything else that would make it look “normal” … but that might have been due to how you formatted the code?
If so you might need to repost it in full with the above formatting method. Thanks.