Closed jrwren closed 3 months ago
Sorry, there is a step missing in that tutorial.
You have to add the dependency to the HelloWorld target as well:
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.executableTarget(
name: "HelloWorld",
dependencies: [.product(name: "Adwaita", package: "Adwaita")]
),
]
Thank you for reporting this! Does it work after adding the dependency to the target?
It goes further and gives a different error:
error: the executable 'HelloWorld' requires macos 10.13, but depends on the product 'Adwaita' which requires macos 10.15; consider changing the executable 'HelloWorld' to require macos 10.15 or later, or the product 'Adwaita' to require macos 10.13 or earlier.
error: the executable 'HelloWorld' requires macos 10.13, but depends on the product 'Adwaita' which requires macos 10.15; consider changing the executable 'HelloWorld' to require macos 10.15 or later, or the product 'Adwaita' to require macos 10.13 or earlier.
Thanks for the help. I'll send a PR for the tutorial if that is acceptable.
I added
platforms: [
.macOS(.v10_15)
],
and it builds and runs. THANKS!
I've followed the tutorial on macOS myself now and got the error 'main' attribute cannot be used in a module that contains top-level code
. As soon as I renamed the main.swift
to HelloWorld.swift
the error disappeared. I'll have to add this to the tutorial if there's no more elegant solution.
I'll add the macOS version specification to the tutorial as well.
I added the file name thing as well in 409dfb6. Thanks for reporting!
Describe the bug
Following https://github.com/AparokshaUI/adwaita-swift/blob/main/user-manual/Basics/HelloWorld.md on macos 14.4 and get import error
To Reproduce
Do the tutorial on macos 14.4
See it fail on swift run step.
Expected behavior
What the tutorial says.
Additional context