Always include the error when you get one. It's not just random text, but explains exactly what is going on. Even if you may not get it, others probably will understand.
Sounds like you may have updated your header files, but when linking you're still using the older SFML libs where getNativeHandle() didn't exist.
Remove all the the traces of SFML on your system, especially when you installed the official SFML package before and then just re-install your own build of SFML.