As joan pointed out, the problem here are the two incompatible architectures. You can use a cross-compiler, but if your code will compile reasonably quickly on the pi, which it probably will if it is fairly simple, you could also either work directly on the pi or do what I recommend, work remotely.
First make sure that the compile time really isn't too much by trying it on the pi.
To work remotely, you can either do this via your IDE/editor directly if it has such a feature, or else mount part of the pi's filesystem as a remote filesystem;
sshfs is good for this, particularly if you are already using
ssh. Mounting the fs is probably a simpler option than trying to use a feature of the editor because there is less need for confusion and configuration of the compiler -- you simply don't compile via the IDE. Auto-complete and syntax checks obviously still work, but to actually compile and test, just keep a terminal open logged in via
ssh to the pi and do it manually.