In most large cities squatting cannot be a longer term solution, as it often doesnt take long to be explused from a place (in paris for example squats stay around from 2 to 6 months on average if you are lucky enough to manage to secure the place for the first week or so).
Also depending on who runs and occupies the building, it might actually not always be a safe/sane housing option neither.