Temporary resident visa
The law says
A foreign national may not enter Canada to remain on a temporary basis without first obtaining a temporary resident visa.
What that means
Unless you are on the exempt list, you need a visitor visa before you travel to Canada. This cannot be fixed at the airport. A temporary resident permit or an authorization to re-enter does the job instead. People coming to Quebec for medical care may need one more document. If Quebec law requires it, they need a certificat d'acceptation du Quebec as well as the visa.