My teacher said that "the whole country" is not correct and that we must say "the whole of the country". Unfortunately she couldn't give me any explanation. Is she right?

The sentence was "The whole of the country was occupied during the war."

I know that we must use "the whole of" before pronouns and proper name. But "country" is a noun. Why we can say "the whole book" and can't "the whole country"?
I have never heard that and do not believe it. 'The whole country was occupied' is fine.
The difference may be the one between:

the entire country (adjective)
the totality/entirety of the country (noun)

Also, this may be pondial (AmE vs BrE):

BBC - Editorial Guidelines - Impartiality - Controversial subjects

In the United Kingdom controversial subjects are issues of significance for the whole of the country, such as elections, or highly contentious new ...
Site Hint: Check out our list of pronunciation videos.
I've found a lot of examples of "the whole country" on the Internet. It's absolutely correct.
Now the question is what is the difference between "the whole country" and "the whole of the country"? Unfortunately I can't see the difference.
Teachers: We supply a list of EFL job vacancies