compnerd / swift-win32

A Windows application framework for Swift
https://compnerd.github.io/swift-win32/
BSD 3-Clause "New" or "Revised" License
1.11k stars 69 forks source link

error: cannot find type 'BarButtonItem' in scope; examples don't compile #747

Closed Ilyab99 closed 1 year ago

Ilyab99 commented 1 year ago

C:\Users\Ilya Bagleybter\Desktop\swift-win32\Sources\SwiftWin32\View Controllers\ViewController.swift:1151:46: error: cannot find type 'BarButtonItem' in scope open func setToolbarItems(_ toolbarItems: [BarButtonItem]?, animated: Bool) { ^~~~~~~~~~~~~ error: fatalError ninja: build stopped: subcommand failed.

since it doesn't appear to be implemented removing any mentions of ViewController.swift fixes it

compnerd commented 1 year ago

How are you building? I think I might’ve failed to update the CMakeLists.txt as the CI didn’t error out.

nmilev-scribe commented 1 year ago

I am experiencing the same issue. Trying to build from Visual Studio 2022 by simply selecting "build all". I also tried building via the instructions given here, but the same error occurs.

compnerd commented 1 year ago

Okay, so building via CMake. Thank you, let me see if I can reproduce the issue.

compnerd commented 1 year ago

@nmilev-scribe would you happen to be able to try with the SPM instructions? I suspect that they are more robust due to the CI building with SPM only atm.