Are you attempting cross compile? If so, and if possible, I'd recommend compiling on the RPI it self. If that is not an option and you must cross compile, I think you will need to have the armhf compiled versions of dependency libraries available to link against? Right? You can do this by popping your RPI sdcard into your pc and telling ld to use it's '/usr/lib' dir.
arm-linux-gnueabi-g++ -o FOTOSHOWarm SHOW4.cpp -L/mnt/$USER/SDCARD_LABEL/usr/lib -lX11 -lpthread