First of all, the tutorial specifies /Library/Frameworks, not ~/Library/Frameworks. ~ points to the user home directory (/Users/name/), whereas / points to the lowest point on the filesystem.
Also despite the documentation, /Library/Frameworks is not a standard framework directory, so you have to set it in the search paths. You can see the standard framework directories by running gcc -Xlinker -v:
@(#)PROGRAM:ld PROJECT:ld64-409.12
BUILD 17:47:51 Sep 25 2018
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em arm64e arm64_32
Library search paths:
/usr/local/lib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib
Framework search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Note the Framework search paths section, it does not include /Library/Frameworks.
To add /Library/Frameworks to the search path, compile with -F/Library/Frameworks and link with -F/Library/Frameworks -framework SFML -framework sfml-x, x being system, window, graphics, audio or network.
Also, the -o option specifies the output filename. Your command would take no input files and output the executable sfml-test.cpp, so use -o sfml-test sfml-test.cpp to take sfml-test.cpp as input, and output sfml-test.
Your command would be:
g++ -o sfml-test sfml-test.cpp -F/Library/Frameworks -framework SFML -framework sfml-window