Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DarwinKit: an error occurs when build #256

Open
Charliego3 opened this issue May 12, 2024 · 0 comments
Open

DarwinKit: an error occurs when build #256

Charliego3 opened this issue May 12, 2024 · 0 comments

Comments

@Charliego3
Copy link
Contributor

> go run main.go
# github.com/progrium/macdriver/macos/metal
protocols.gen.m:33:10: error: cannot find protocol declaration for 'MTLFunctionStitchingAttribute'
protocols.gen.m:34:10: error: cannot find protocol declaration for 'MTLFunctionStitchingNode'

I'm running example code like this:

package main

import (
	"github.com/progrium/macdriver/macos"
	"github.com/progrium/macdriver/macos/appkit"
	"github.com/progrium/macdriver/macos/foundation"
	"github.com/progrium/macdriver/macos/webkit"
	"github.com/progrium/macdriver/objc"
)

func main() {
	// runs macOS application event loop with a callback on success
	macos. RunApp(func(app appkit. Application, delegate *appkit. ApplicationDelegate) {
		app. SetActivationPolicy(appkit. ApplicationActivationPolicyRegular)
		app. ActivateIgnoringOtherApps(true)

		url := foundation. URL_URLWithString("http://progrium.com")
		req := foundation. NewURLRequestWithURL(url)
		frame := foundation. Rect{Size: foundation. Size{Width: 1440, Height: 900}}

		config := webkit. NewWebViewConfiguration()
		wv := webkit. NewWebViewWithFrameConfiguration(frame, config)
		wv. LoadRequest(req)

		w := appkit. NewWindowWithContentRectStyleMaskBackingDefer(frame,
			appkit. ClosableWindowMask|appkit. TitledWindowMask,
			appkit. BackingStoreBuffered, false)
		objc. Retain(&w)
		w.SetContentView(wv)
		w.MakeKeyAndOrderFront(w)
		w.Center()

		delegate. SetApplicationShouldTerminateAfterLastWindowClosed(func(appkit. Application) bool {
			return true
		})
	})
}

macOS version: Ventura 13.6.6
go version: go1.22.3 darwin/amd64

How can I fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant