Let's say it this way: if library A needs something from library B, that something will be "searched" in the following libraries, not the previous ones, so you need to put A first, then B. While this may not be an accurate definition, the basic idea is there.
In your case, wxmsw_richtext needs something from wxmsw, that's why wxmsw must go after wxmsw_richtext.
If that's a wizard's fault, inform it.