examples failing to compile #1

Open
opened 2020-08-05 10:18:58 -04:00 by joe-getcouragenow · 2 comments
First-time contributor

The example is not running for me.

I wonder if its because i dont have the header files ?
See CoreFoundation.framework further down for example...


go version go1.14.6 darwin/amd64


go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/Users/apple/workspace/go/bin"
GOCACHE="/Users/apple/Library/Caches/go-build"
GOENV="/Users/apple/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/apple/workspace/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/opt/go/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T/go-build323844933=/tmp/go-build -gno-record-gcc-switches -fno-common"

clang env:

clang --version
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Objective-C header files:


➜  Frameworks ls -al
total 0
drwxr-xr-x  176 root  wheel  5632 Mar 28 13:38 .
drwxr-xr-x  116 root  wheel  3712 Oct 31  2019 ..
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 AGL.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 AVFoundation.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 AVKit.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 Accelerate.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Accounts.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 AdSupport.framework
drwxr-xr-x    7 root  wheel   224 Oct 31  2019 AddressBook.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 AppKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 AppleScriptKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 AppleScriptObjC.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 ApplicationServices.framework
drwxr-xr-x    7 root  wheel   224 May 28 09:15 AudioToolbox.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 AudioUnit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 AudioVideoBridging.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 AuthenticationServices.framework
drwxr-xr-x    5 root  wheel   160 Mar 28 13:38 AutomaticAssessmentConfiguration.framework
drwxr-xr-x    7 root  wheel   224 Oct 31  2019 Automator.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 BackgroundTasks.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 BusinessChat.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CFNetwork.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CalendarStore.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CallKit.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 Carbon.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CloudKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Cocoa.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Collaboration.framework
drwxr-xr-x    7 root  wheel   224 Oct 31  2019 ColorSync.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Combine.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Contacts.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ContactsUI.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 CoreAudio.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreAudioKit.framework
drwxr-xr-x    4 root  wheel   128 May 28 09:15 CoreAudioTypes.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreBluetooth.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreData.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 CoreDisplay.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreFoundation.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreGraphics.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreHaptics.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreImage.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 CoreLocation.framework
drwxr-xr-x    6 root  wheel   192 May 28 09:15 CoreMIDI.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreMIDIServer.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreML.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 CoreMedia.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 CoreMediaIO.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreMotion.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 CoreServices.framework
drwxr-xr-x    6 root  wheel   192 May 28 09:15 CoreSpotlight.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 CoreTelephony.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreText.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreVideo.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CoreWLAN.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 CryptoKit.framework
drwxr-xr-x   10 root  wheel   320 May 28 09:15 CryptoTokenKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 DVDPlayback.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 DeviceCheck.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 DirectoryService.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 DiscRecording.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 DiscRecordingUI.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 DiskArbitration.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 DriverKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 EventKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ExceptionHandling.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ExecutionPolicy.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ExternalAccessory.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 FWAUserLib.framework
drwxr-xr-x    9 root  wheel   288 Oct 31  2019 FileProvider.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 FileProviderUI.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 FinderSync.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ForceFeedback.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 Foundation.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 GLKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 GLUT.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 GSS.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 GameController.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 GameKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 GameplayKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 HIDDriverKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Hypervisor.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ICADevices.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 IMServicePlugIn.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 IOBluetooth.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 IOBluetoothUI.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 IOKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 IOSurface.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 IOUSBHost.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 IdentityLookup.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ImageCaptureCore.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 ImageIO.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 InputMethodKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 InstallerPlugins.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 InstantMessage.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Intents.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 JavaFrameEmbedding.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 JavaScriptCore.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 JavaVM.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Kerberos.framework
drwxr-xr-x    4 root  wheel   128 Jun  2 22:05 Kernel.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 LDAP.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 LatentSemanticMapping.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 LinkPresentation.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 LocalAuthentication.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 MapKit.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 MediaAccessibility.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 MediaLibrary.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 MediaPlayer.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 MediaToolbox.framework
drwxr-xr-x    4 root  wheel   128 May 28 09:15 Message.framework
drwxr-xr-x    7 root  wheel   224 Oct 31  2019 Metal.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 MetalKit.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 MetalPerformanceShaders.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 MetricKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ModelIO.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 MultipeerConnectivity.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 NaturalLanguage.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 NetFS.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Network.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 NetworkExtension.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 NetworkingDriverKit.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 NotificationCenter.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 OSAKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 OSLog.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 OpenAL.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 OpenCL.framework
drwxr-xr-x    7 root  wheel   224 May 28 09:15 OpenDirectory.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 OpenGL.framework
drwxr-xr-x    5 root  wheel   160 Mar 28 13:38 PCIDriverKit.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 PCSC.framework
drwxr-xr-x    5 root  wheel   160 Dec 11  2019 PDFKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 PencilKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Photos.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 PhotosUI.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 PreferencePanes.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 PushKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Python.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 QTKit.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 Quartz.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 QuartzCore.framework
drwxr-xr-x    7 root  wheel   224 Oct 31  2019 QuickLook.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 QuickLookThumbnailing.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 RealityKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Ruby.framework
lrwxr-xr-x    1 root  wheel    73 Oct 31  2019 SafariServices.framework -> ../../../Library/Apple/System/Library/Frameworks/SafariServices.framework
drwxr-xr-x    7 root  wheel   224 Oct 31  2019 SceneKit.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 ScreenSaver.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ScriptingBridge.framework
drwxr-xr-x    8 root  wheel   256 May 28 09:15 Security.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 SecurityFoundation.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 SecurityInterface.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 ServiceManagement.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 Social.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 SoundAnalysis.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Speech.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 SpriteKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 StoreKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 SwiftUI.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 SyncServices.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 System.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 SystemConfiguration.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 SystemExtensions.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 TWAIN.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 Tcl.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 Tk.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 USBDriverKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 UserNotifications.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 VideoDecodeAcceleration.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 VideoSubscriberAccount.framework
drwxr-xr-x    6 root  wheel   192 Oct 31  2019 VideoToolbox.framework
drwxr-xr-x    6 root  wheel   192 May 28 09:15 Vision.framework
drwxr-xr-x    7 root  wheel   224 Oct 31  2019 WebKit.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 iTunesLibrary.framework
lrwxr-xr-x    1 root  wheel    60 Oct 31  2019 vecLib.framework -> Accelerate.framework//Versions/A/Frameworks/vecLib.framework
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 vmnet.framework


➜  Frameworks cd CoreFoundation.framework
➜  CoreFoundation.framework ls -al
total 0
drwxr-xr-x    5 root  wheel   160 Oct 31  2019 .
drwxr-xr-x  176 root  wheel  5632 Mar 28 13:38 ..
lrwxr-xr-x    1 root  wheel    31 Oct 31  2019 CoreFoundation -> Versions/Current/CoreFoundation
lrwxr-xr-x    1 root  wheel    26 Oct 31  2019 Resources -> Versions/Current/Resources
drwxr-xr-x    4 root  wheel   128 Oct 31  2019 Versions

install nswrap:


cd /Users/apple/workspace/go/src/git.wow.st/gmp/nswrap && go install
which nswrap
/Users/apple/workspace/go/bin/nswrap

Build example:

cd /Users/apple/workspace/go/src/git.wow.st/gmp/nswrap/examples/app && go generate && go build && ./app
Generating AST
clang -xobjective-c -Xclang -ast-dump -fsyntax-only -fno-color-diagnostics /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h
Building nodes
Assembling tree
--processing translation unit
AST parse error: node type is *ast.SwiftNameAttr
--processing translation unit
AST parse error: node type is *ast.SwiftNameAttr
Writing output to ns/main.go
Interface NSObject: 18 properties, 35 class methods, 238 instance methods
Interface NSNotification: 3 properties, 39 class methods, 246 instance methods
Interface NSLayoutConstraint: 13 properties, 40 class methods, 260 instance methods
Interface NSArray: 5 properties, 46 class methods, 602 instance methods
Interface NSButton: 23 properties, 48 class methods, 759 instance methods
Interface NSMenu: 17 properties, 41 class methods, 590 instance methods
Interface NSMenuItem: 29 properties, 38 class methods, 571 instance methods
Interface NSControl: 25 properties, 43 class methods, 703 instance methods
Interface NSAutoreleasePool: 0 properties, 36 class methods, 240 instance methods
Interface NSString: 36 properties, 73 class methods, 440 instance methods
Interface NSApplication: 30 properties, 38 class methods, 692 instance methods
Interface NSWindow: 119 properties, 50 class methods, 931 instance methods
Interface NSView: 104 properties, 42 class methods, 951 instance methods
Interface NSDictionary: 5 properties, 50 class methods, 518 instance methods
Delegate AppDelegate <NSApplicationDelegate>: 4 methods
  subclass for NSButton
Adding methods for interface NSObject
Adding methods for interface NSResponder
Adding methods for interface NSView
Adding methods for interface NSControl
Adding methods for interface NSButton
METHODS:
  -> dealloc
Adding method pressed to subclass
Subclass GButton <NSButton>: 1 overrides, 1 new methods
1 functions
15 enums
# git.wow.st/gmp/nswrap/examples/app/ns
ns/main.go:58168:35: expected type, found '.'
ns/main.go:59357:10: expected operand, found ')'
ns/main.go:59359:2: expected ')', found 'return'
ns/main.go:61157:10: expected operand, found ')'
ns/main.go:61159:2: expected ')', found 'return'
ns/main.go:63187:10: expected operand, found ')'
ns/main.go:63189:2: expected ')', found 'return'
ns/main.go:63887:54: expected selector or type assertion, found ')'
ns/main.go:63888:22: missing ',' before newline in argument list
ns/main.go:63889:1: expected operand, found '}'
ns/main.go:63894:2: missing ',' in argument list
make: *** [this-nsw-run] Error 2
The example is not running for me. I wonder if its because i dont have the header files ? See CoreFoundation.framework further down for example... ``` go version go1.14.6 darwin/amd64 go env GO111MODULE="on" GOARCH="amd64" GOBIN="/Users/apple/workspace/go/bin" GOCACHE="/Users/apple/Library/Caches/go-build" GOENV="/Users/apple/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/apple/workspace/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/opt/go/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T/go-build323844933=/tmp/go-build -gno-record-gcc-switches -fno-common" ``` clang env: ``` clang --version Apple clang version 11.0.3 (clang-1103.0.32.62) Target: x86_64-apple-darwin19.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin ``` Objective-C header files: ``` ➜ Frameworks ls -al total 0 drwxr-xr-x 176 root wheel 5632 Mar 28 13:38 . drwxr-xr-x 116 root wheel 3712 Oct 31 2019 .. drwxr-xr-x 5 root wheel 160 Oct 31 2019 AGL.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 AVFoundation.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 AVKit.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 Accelerate.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Accounts.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 AdSupport.framework drwxr-xr-x 7 root wheel 224 Oct 31 2019 AddressBook.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 AppKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 AppleScriptKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 AppleScriptObjC.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 ApplicationServices.framework drwxr-xr-x 7 root wheel 224 May 28 09:15 AudioToolbox.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 AudioUnit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 AudioVideoBridging.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 AuthenticationServices.framework drwxr-xr-x 5 root wheel 160 Mar 28 13:38 AutomaticAssessmentConfiguration.framework drwxr-xr-x 7 root wheel 224 Oct 31 2019 Automator.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 BackgroundTasks.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 BusinessChat.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CFNetwork.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CalendarStore.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CallKit.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 Carbon.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CloudKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Cocoa.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Collaboration.framework drwxr-xr-x 7 root wheel 224 Oct 31 2019 ColorSync.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Combine.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Contacts.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ContactsUI.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 CoreAudio.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreAudioKit.framework drwxr-xr-x 4 root wheel 128 May 28 09:15 CoreAudioTypes.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreBluetooth.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreData.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 CoreDisplay.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreFoundation.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreGraphics.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreHaptics.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreImage.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 CoreLocation.framework drwxr-xr-x 6 root wheel 192 May 28 09:15 CoreMIDI.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreMIDIServer.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreML.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 CoreMedia.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 CoreMediaIO.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreMotion.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 CoreServices.framework drwxr-xr-x 6 root wheel 192 May 28 09:15 CoreSpotlight.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 CoreTelephony.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreText.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreVideo.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CoreWLAN.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 CryptoKit.framework drwxr-xr-x 10 root wheel 320 May 28 09:15 CryptoTokenKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 DVDPlayback.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 DeviceCheck.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 DirectoryService.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 DiscRecording.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 DiscRecordingUI.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 DiskArbitration.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 DriverKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 EventKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ExceptionHandling.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ExecutionPolicy.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ExternalAccessory.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 FWAUserLib.framework drwxr-xr-x 9 root wheel 288 Oct 31 2019 FileProvider.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 FileProviderUI.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 FinderSync.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ForceFeedback.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 Foundation.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 GLKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 GLUT.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 GSS.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 GameController.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 GameKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 GameplayKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 HIDDriverKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Hypervisor.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ICADevices.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 IMServicePlugIn.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 IOBluetooth.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 IOBluetoothUI.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 IOKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 IOSurface.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 IOUSBHost.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 IdentityLookup.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ImageCaptureCore.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 ImageIO.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 InputMethodKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 InstallerPlugins.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 InstantMessage.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Intents.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 JavaFrameEmbedding.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 JavaScriptCore.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 JavaVM.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Kerberos.framework drwxr-xr-x 4 root wheel 128 Jun 2 22:05 Kernel.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 LDAP.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 LatentSemanticMapping.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 LinkPresentation.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 LocalAuthentication.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 MapKit.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 MediaAccessibility.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 MediaLibrary.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 MediaPlayer.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 MediaToolbox.framework drwxr-xr-x 4 root wheel 128 May 28 09:15 Message.framework drwxr-xr-x 7 root wheel 224 Oct 31 2019 Metal.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 MetalKit.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 MetalPerformanceShaders.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 MetricKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ModelIO.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 MultipeerConnectivity.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 NaturalLanguage.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 NetFS.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Network.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 NetworkExtension.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 NetworkingDriverKit.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 NotificationCenter.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 OSAKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 OSLog.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 OpenAL.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 OpenCL.framework drwxr-xr-x 7 root wheel 224 May 28 09:15 OpenDirectory.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 OpenGL.framework drwxr-xr-x 5 root wheel 160 Mar 28 13:38 PCIDriverKit.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 PCSC.framework drwxr-xr-x 5 root wheel 160 Dec 11 2019 PDFKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 PencilKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Photos.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 PhotosUI.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 PreferencePanes.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 PushKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Python.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 QTKit.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 Quartz.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 QuartzCore.framework drwxr-xr-x 7 root wheel 224 Oct 31 2019 QuickLook.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 QuickLookThumbnailing.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 RealityKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Ruby.framework lrwxr-xr-x 1 root wheel 73 Oct 31 2019 SafariServices.framework -> ../../../Library/Apple/System/Library/Frameworks/SafariServices.framework drwxr-xr-x 7 root wheel 224 Oct 31 2019 SceneKit.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 ScreenSaver.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ScriptingBridge.framework drwxr-xr-x 8 root wheel 256 May 28 09:15 Security.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 SecurityFoundation.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 SecurityInterface.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 ServiceManagement.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 Social.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 SoundAnalysis.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Speech.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 SpriteKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 StoreKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 SwiftUI.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 SyncServices.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 System.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 SystemConfiguration.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 SystemExtensions.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 TWAIN.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 Tcl.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 Tk.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 USBDriverKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 UserNotifications.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 VideoDecodeAcceleration.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 VideoSubscriberAccount.framework drwxr-xr-x 6 root wheel 192 Oct 31 2019 VideoToolbox.framework drwxr-xr-x 6 root wheel 192 May 28 09:15 Vision.framework drwxr-xr-x 7 root wheel 224 Oct 31 2019 WebKit.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 iTunesLibrary.framework lrwxr-xr-x 1 root wheel 60 Oct 31 2019 vecLib.framework -> Accelerate.framework//Versions/A/Frameworks/vecLib.framework drwxr-xr-x 5 root wheel 160 Oct 31 2019 vmnet.framework ➜ Frameworks cd CoreFoundation.framework ➜ CoreFoundation.framework ls -al total 0 drwxr-xr-x 5 root wheel 160 Oct 31 2019 . drwxr-xr-x 176 root wheel 5632 Mar 28 13:38 .. lrwxr-xr-x 1 root wheel 31 Oct 31 2019 CoreFoundation -> Versions/Current/CoreFoundation lrwxr-xr-x 1 root wheel 26 Oct 31 2019 Resources -> Versions/Current/Resources drwxr-xr-x 4 root wheel 128 Oct 31 2019 Versions ``` install *nswrap*: ``` cd /Users/apple/workspace/go/src/git.wow.st/gmp/nswrap && go install which nswrap /Users/apple/workspace/go/bin/nswrap ``` Build example: ``` cd /Users/apple/workspace/go/src/git.wow.st/gmp/nswrap/examples/app && go generate && go build && ./app Generating AST clang -xobjective-c -Xclang -ast-dump -fsyntax-only -fno-color-diagnostics /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h Building nodes Assembling tree --processing translation unit AST parse error: node type is *ast.SwiftNameAttr --processing translation unit AST parse error: node type is *ast.SwiftNameAttr Writing output to ns/main.go Interface NSObject: 18 properties, 35 class methods, 238 instance methods Interface NSNotification: 3 properties, 39 class methods, 246 instance methods Interface NSLayoutConstraint: 13 properties, 40 class methods, 260 instance methods Interface NSArray: 5 properties, 46 class methods, 602 instance methods Interface NSButton: 23 properties, 48 class methods, 759 instance methods Interface NSMenu: 17 properties, 41 class methods, 590 instance methods Interface NSMenuItem: 29 properties, 38 class methods, 571 instance methods Interface NSControl: 25 properties, 43 class methods, 703 instance methods Interface NSAutoreleasePool: 0 properties, 36 class methods, 240 instance methods Interface NSString: 36 properties, 73 class methods, 440 instance methods Interface NSApplication: 30 properties, 38 class methods, 692 instance methods Interface NSWindow: 119 properties, 50 class methods, 931 instance methods Interface NSView: 104 properties, 42 class methods, 951 instance methods Interface NSDictionary: 5 properties, 50 class methods, 518 instance methods Delegate AppDelegate <NSApplicationDelegate>: 4 methods subclass for NSButton Adding methods for interface NSObject Adding methods for interface NSResponder Adding methods for interface NSView Adding methods for interface NSControl Adding methods for interface NSButton METHODS: -> dealloc Adding method pressed to subclass Subclass GButton <NSButton>: 1 overrides, 1 new methods 1 functions 15 enums # git.wow.st/gmp/nswrap/examples/app/ns ns/main.go:58168:35: expected type, found '.' ns/main.go:59357:10: expected operand, found ')' ns/main.go:59359:2: expected ')', found 'return' ns/main.go:61157:10: expected operand, found ')' ns/main.go:61159:2: expected ')', found 'return' ns/main.go:63187:10: expected operand, found ')' ns/main.go:63189:2: expected ')', found 'return' ns/main.go:63887:54: expected selector or type assertion, found ')' ns/main.go:63888:22: missing ',' before newline in argument list ns/main.go:63889:1: expected operand, found '}' ns/main.go:63894:2: missing ',' in argument list make: *** [this-nsw-run] Error 2 ```
Owner

You have the headers but they include AST nodes that are not recognized by the tool.

What version of MacOS are you running?

Please run 'clang --version' and let me know what it says.

Can you send me the output of the following command:

$ clang -xobjective-c -Xclang -ast-dump -fsyntax-only -fno-color-diagnostics /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h

You have the headers but they include AST nodes that are not recognized by the tool. What version of MacOS are you running? Please run 'clang --version' and let me know what it says. Can you send me the output of the following command: $ clang -xobjective-c -Xclang -ast-dump -fsyntax-only -fno-color-diagnostics /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h
Owner

The latest update should fix these issues.

The latest update should fix these issues.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gmp/nswrap#1
No description provided.