I just took the current head (09790c1c642ff71ed751dcdda965b5621079292a) of swift-png, and compilation (swift build
). was successful on Windows 11, but had the mentioned error ('main' attribute cannot be used in a module that contains top-level code
) on Windows 10. This was the same with Swift 5.9(.0) and Swift 5.9.1.
On both systems: Visual Studio 2022 17.7.5, MSVC v143, Windows 10 SDK 10.0.19041.0. (Note that in the other topic I also tried other Windows SDK versions for my own project, that did not change anything in this regard.)
It only tested it on one Windows 10 system and on one Windows 11 system, and so it should probably be confirmed by others.