ebitengine / purego

Apache License 2.0
1.95k stars 63 forks source link

Import AVFoundation.framework failed in Mac Sonoma #184

Closed anhoder closed 7 months ago

anhoder commented 7 months ago
package main

import (
    "github.com/ebitengine/purego"
)

func main() {
    _, err := purego.Dlopen("AVFoundation.framework/AVFoundation", purego.RTLD_GLOBAL)
    if err != nil {
        panic(err)
    }
}

When I run it in Mac Sonoma(14.0), I receive the following error message:

panic: dlopen(AVFoundation.framework/AVFoundation, 0x0008): tried: 'AVFoundation.framework/AVFoundation' (no such file), '/System/Volumes/Preboot/Cryptexes/OSAVFoundation.framework/AVFoundation' (no such file), '/usr/lib/AVFoundation.framework/AVFoundation' (no such file, not in dyld cache), 'AVFoundation.framework/AVFoundation' (no such file)

goroutine 1 [running]:
main.main()
        /Users/anhoder/Desktop/test/main.go:10 +0x50
exit status 2

But it worked very well in previous versions (MacOS version < 14.0) How should I import the framework in Sonoma?

hajimehoshi commented 7 months ago

Use a full path. Unfortunately this is an imcompatible behavior in Xcode (https://github.com/hajimehoshi/ebiten/issues/2732).

anhoder commented 7 months ago

OK, Thank you!