I can't remember exactly where it is mentioned (it is somewhere) but in SWI-Prolog you need to put
:- use_module(library(clpfd)).
at the top of your file (or just use_module(library(clpfd)). at the console)