Fix and workaround unresolved externals in VS builds.