ld errors when compiling on M1 Mac
I tried to compile the example in the README and get a bunch of ld errors like below. There are too many for my terminal to show, but the it's basically the first line with different numbers over and over.
ld: warning: pointer not aligned at address 0x1002345F7 ('_type.*' + 83447 from /var/folders/l1/bymjznz5677dy5_mb5x102pr0000gn/T/go-link-1741470286/go.o) ld: unaligned pointer(s) for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried to build with GOARCH=amd64 but that also errors out with the following
# github.com/gen2brain/raylib-go/raylib ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:8:20: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:13:19: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:18:24: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:23:29: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:28:22: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:33:31: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:38:29: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:43:26: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:49:21: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:54:29: undefined: Vector2 ../../../share/go/src/github.com/gen2brain/raylib-go/raylib/raymath.go:54:29: too many errors
After reinstalling xcode I now get the following error
Spoiler warning
/opt/homebrew/Cellar/go/1.18.3/libexec/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
Undefined symbols for architecture arm64:
"_objc_msgSend$IBeamCursor", referenced from:
__glfwPlatformCreateStandardCursor in 000002.o
"_objc_msgSend$UTF8String", referenced from:
__glfwPlatformGetClipboardString in 000002.o
__glfwPollMonitorsNS in 000002.o
"_objc_msgSend$activateIgnoringOtherApps:", referenced from:
_glfwCreateWindow in 000002.o
__glfwPlatformCreateWindow in 000002.o
__glfwPlatformFocusWindow in 000002.o
_glfwShowWindow in 000002.o
_glfwFocusWindow in 000002.o
"_objc_msgSend$addItem:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$addItemWithTitle:action:keyEquivalent:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$addLocalMonitorForEventsMatchingMask:handler:", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$addObserver:selector:name:object:", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$addRepresentation:", referenced from:
__glfwPlatformCreateCursor in 000002.o
"_objc_msgSend$addTrackingArea:", referenced from:
-[GLFWContentView updateTrackingAreas] in 000002.o
"_objc_msgSend$alphaValue", referenced from:
_glfwGetWindowOpacity in 000002.o
__glfwPlatformGetWindowOpacity in 000002.o
"_objc_msgSend$array", referenced from:
-[GLFWContentView validAttributesForMarkedText] in 000002.o
"_objc_msgSend$arrayWithObjects:count:", referenced from:
_glfwSetClipboardString in 000002.o
__glfwPlatformSetClipboardString in 000002.o
-[GLFWContentView initWithGlfwWindow:] in 000002.o
-[GLFWContentView keyDown:] in 000002.o
-[GLFWContentView performDragOperation:] in 000002.o
"_objc_msgSend$arrowCursor", referenced from:
__glfwPlatformSetCursorPos in 000002.o
__glfwPlatformCreateStandardCursor in 000002.o
__glfwPlatformSetCursor in 000002.o
_updateCursorMode in 000002.o
-[GLFWContentView cursorUpdate:] in 000002.o
"_objc_msgSend$backingScaleFactor", referenced from:
__glfwPlatformCreateWindowSurface in 000002.o
-[GLFWContentView viewDidChangeBackingProperties] in 000002.o
"_objc_msgSend$bitmapData", referenced from:
__glfwPlatformCreateCursor in 000002.o
"_objc_msgSend$bounds", referenced from:
-[GLFWContentView updateTrackingAreas] in 000002.o
"_objc_msgSend$bundleWithPath:", referenced from:
__glfwPlatformCreateWindowSurface in 000002.o
"_objc_msgSend$buttonNumber", referenced from:
-[GLFWContentView otherMouseDown:] in 000002.o
-[GLFWContentView otherMouseUp:] in 000002.o
"_objc_msgSend$bytes", referenced from:
__glfwPlatformGetScancodeName in 000002.o
"_objc_msgSend$cascadeTopLeftFromPoint:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$center", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$classNamed:", referenced from:
__glfwPlatformCreateWindowSurface in 000002.o
"_objc_msgSend$clearColor", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$clearCurrentContext", referenced from:
_makeContextCurrentNSGL in 000002.o
"_objc_msgSend$close", referenced from:
__glfwPlatformDestroyWindow in 000002.o
"_objc_msgSend$closedHandCursor", referenced from:
__glfwPlatformCreateStandardCursor in 000002.o
"_objc_msgSend$containsObject:", referenced from:
__glfwPlatformGetClipboardString in 000002.o
"_objc_msgSend$contentRectForFrameRect:", referenced from:
_glfwGetWindowPos in 000002.o
__glfwPlatformGetWindowPos in 000002.o
__glfwPlatformSetWindowSize in 000002.o
-[GLFWWindowDelegate windowDidMove:] in 000002.o
"_objc_msgSend$convertRectToBacking:", referenced from:
_glfwGetMonitorContentScale in 000002.o
__glfwPlatformGetMonitorContentScale in 000002.o
__glfwPlatformCreateWindow in 000002.o
_glfwGetFramebufferSize in 000002.o
__glfwPlatformGetFramebufferSize in 000002.o
_glfwGetWindowContentScale in 000002.o
__glfwPlatformGetWindowContentScale in 000002.o
...
"_objc_msgSend$convertRectToScreen:", referenced from:
__glfwPlatformSetCursorPos in 000002.o
__glfwPlatformWindowHovered in 000002.o
"_objc_msgSend$count", referenced from:
-[GLFWContentView performDragOperation:] in 000002.o
"_objc_msgSend$countByEnumeratingWithState:objects:count:", referenced from:
__glfwPollMonitorsNS in 000002.o
"_objc_msgSend$crosshairCursor", referenced from:
__glfwPlatformCreateStandardCursor in 000002.o
"_objc_msgSend$currentApplication", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$currentEvent", referenced from:
-[GLFWContentView insertText:replacementRange:] in 000002.o
"_objc_msgSend$dateWithTimeIntervalSinceNow:", referenced from:
__glfwPlatformWaitEventsTimeout in 000002.o
"_objc_msgSend$declareTypes:owner:", referenced from:
_glfwSetClipboardString in 000002.o
__glfwPlatformSetClipboardString in 000002.o
"_objc_msgSend$defaultCenter", referenced from:
__glfwPlatformInit in 000002.o
__glfwPlatformTerminate in 000002.o
"_objc_msgSend$deltaX", referenced from:
-[GLFWContentView mouseMoved:] in 000002.o
"_objc_msgSend$deltaY", referenced from:
-[GLFWContentView mouseMoved:] in 000002.o
"_objc_msgSend$deminiaturize:", referenced from:
_glfwRestoreWindow in 000002.o
__glfwPlatformRestoreWindow in 000002.o
"_objc_msgSend$detachNewThreadSelector:toTarget:withObject:", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$deviceDescription", referenced from:
__glfwPollMonitorsNS in 000002.o
"_objc_msgSend$dictionaryWithObjects:forKeys:count:", referenced from:
-[GLFWContentView performDragOperation:] in 000002.o
"_objc_msgSend$distantFuture", referenced from:
__glfwPlatformWaitEvents in 000002.o
"_objc_msgSend$distantPast", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
__glfwPlatformDestroyWindow in 000002.o
_glfwPollEvents in 000002.o
__glfwPlatformPollEvents in 000002.o
__glfwPlatformWaitEvents in 000002.o
__glfwPlatformWaitEventsTimeout in 000002.o
"_objc_msgSend$draggingLocation", referenced from:
-[GLFWContentView performDragOperation:] in 000002.o
"_objc_msgSend$draggingPasteboard", referenced from:
-[GLFWContentView performDragOperation:] in 000002.o
"_objc_msgSend$fileSystemRepresentation", referenced from:
-[GLFWContentView performDragOperation:] in 000002.o
"_objc_msgSend$flushBuffer", referenced from:
_swapBuffersNSGL in 000002.o
"_objc_msgSend$frame", referenced from:
__glfwCenterCursorInContentArea in 000002.o
__glfwPlatformGetWindowSize in 000002.o
__glfwPlatformSetCursorPos in 000002.o
_glfwSetInputMode in 000002.o
__glfwPlatformGetCursorPos in 000002.o
_glfwGetCursorPos in 000002.o
__glfwPlatformSetCursor in 000002.o
...
"_objc_msgSend$frameRectForContentRect:", referenced from:
__glfwInputMonitor in 000002.o
__glfwPlatformGetWindowFrameSize in 000002.o
__glfwPlatformSetWindowPos in 000002.o
_glfwSetWindowPos in 000002.o
__glfwPlatformSetWindowSize in 000002.o
_glfwGetWindowFrameSize in 000002.o
"_objc_msgSend$frameRectForContentRect:styleMask:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
"_objc_msgSend$generalPasteboard", referenced from:
_glfwSetClipboardString in 000002.o
__glfwPlatformSetClipboardString in 000002.o
__glfwPlatformGetClipboardString in 000002.o
"_objc_msgSend$getBytes:maxLength:usedLength:encoding:options:range:remainingRange:", referenced from:
-[GLFWContentView insertText:replacementRange:] in 000002.o
"_objc_msgSend$getValues:forParameter:", referenced from:
_swapBuffersNSGL in 000002.o
"_objc_msgSend$hasPreciseScrollingDeltas", referenced from:
-[GLFWContentView scrollWheel:] in 000002.o
"_objc_msgSend$hide", referenced from:
__glfwPlatformSetCursorPos in 000002.o
__glfwPlatformSetCursor in 000002.o
_updateCursorMode in 000002.o
-[GLFWContentView cursorUpdate:] in 000002.o
-[GLFWContentView mouseEntered:] in 000002.o
"_objc_msgSend$infoDictionary", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$initWithAttributedString:", referenced from:
-[GLFWContentView setMarkedText:selectedRange:replacementRange:] in 000002.o
"_objc_msgSend$initWithAttributes:", referenced from:
__glfwCreateContextNSGL in 000002.o
"_objc_msgSend$initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:", referenced from:
__glfwPlatformCreateCursor in 000002.o
"_objc_msgSend$initWithContentRect:styleMask:backing:defer:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$initWithFormat:shareContext:", referenced from:
__glfwCreateContextNSGL in 000002.o
"_objc_msgSend$initWithGlfwWindow:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$initWithImage:hotSpot:", referenced from:
__glfwPlatformCreateCursor in 000002.o
"_objc_msgSend$initWithRect:options:owner:userInfo:", referenced from:
-[GLFWContentView updateTrackingAreas] in 000002.o
"_objc_msgSend$initWithSize:", referenced from:
__glfwPlatformCreateCursor in 000002.o
"_objc_msgSend$initWithString:", referenced from:
-[GLFWContentView setMarkedText:selectedRange:replacementRange:] in 000002.o
"_objc_msgSend$initWithTitle:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$interpretKeyEvents:", referenced from:
-[GLFWContentView keyDown:] in 000002.o
"_objc_msgSend$isEqualToString:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$isFinishedLaunching", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$isKeyWindow", referenced from:
_glfwSetInputMode in 000002.o
__glfwPlatformSetCursorMode in 000002.o
_glfwSetCursorPos in 000002.o
__glfwPlatformWindowFocused in 000002.o
_glfwGetWindowAttrib in 000002.o
"_objc_msgSend$isMiniaturized", referenced from:
_glfwRestoreWindow in 000002.o
__glfwPlatformRestoreWindow in 000002.o
_glfwGetWindowAttrib in 000002.o
__glfwPlatformWindowIconified in 000002.o
"_objc_msgSend$isOpaque", referenced from:
_glfwGetWindowAttrib in 000002.o
__glfwPlatformFramebufferTransparent in 000002.o
-[GLFWContentView isOpaque] in 000002.o
"_objc_msgSend$isVisible", referenced from:
_glfwGetWindowAttrib in 000002.o
__glfwPlatformWindowVisible in 000002.o
"_objc_msgSend$isZoomed", referenced from:
_glfwRestoreWindow in 000002.o
__glfwPlatformRestoreWindow in 000002.o
_glfwMaximizeWindow in 000002.o
__glfwPlatformMaximizeWindow in 000002.o
_glfwGetWindowAttrib in 000002.o
__glfwPlatformWindowMaximized in 000002.o
-[GLFWWindowDelegate windowDidResize:] in 000002.o
...
"_objc_msgSend$keyCode", referenced from:
-[GLFWContentView keyDown:] in 000002.o
-[GLFWContentView flagsChanged:] in 000002.o
-[GLFWContentView keyUp:] in 000002.o
"_objc_msgSend$keyWindow", referenced from:
____glfwPlatformInit_block_invoke in 000002.o
"_objc_msgSend$layer", referenced from:
__glfwPlatformCreateWindowSurface in 000002.o
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$length", referenced from:
-[GLFWContentView hasMarkedText] in 000002.o
-[GLFWContentView markedRange] in 000002.o
-[GLFWContentView insertText:replacementRange:] in 000002.o
"_objc_msgSend$loadNibNamed:owner:topLevelObjects:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$locationInWindow", referenced from:
-[GLFWContentView mouseMoved:] in 000002.o
"_objc_msgSend$mainBundle", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$makeCurrentContext", referenced from:
_makeContextCurrentNSGL in 000002.o
"_objc_msgSend$makeFirstResponder:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
__glfwPlatformCreateWindow in 000002.o
_glfwSetWindowAttrib in 000002.o
__glfwPlatformSetWindowDecorated in 000002.o
"_objc_msgSend$makeKeyAndOrderFront:", referenced from:
_glfwCreateWindow in 000002.o
__glfwPlatformCreateWindow in 000002.o
__glfwPlatformFocusWindow in 000002.o
_glfwShowWindow in 000002.o
_glfwFocusWindow in 000002.o
"_objc_msgSend$miniaturize:", referenced from:
_glfwIconifyWindow in 000002.o
__glfwPlatformIconifyWindow in 000002.o
-[GLFWWindowDelegate windowDidResignKey:] in 000002.o
"_objc_msgSend$miniwindowTitle", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
"_objc_msgSend$modifierFlags", referenced from:
____glfwPlatformInit_block_invoke in 000002.o
-[GLFWContentView mouseDown:] in 000002.o
-[GLFWContentView mouseUp:] in 000002.o
-[GLFWContentView rightMouseDown:] in 000002.o
-[GLFWContentView rightMouseUp:] in 000002.o
-[GLFWContentView otherMouseDown:] in 000002.o
-[GLFWContentView otherMouseUp:] in 000002.o
...
"_objc_msgSend$mouse:inRect:", referenced from:
__glfwPlatformSetCursor in 000002.o
_updateCursorMode in 000002.o
"_objc_msgSend$mouseLocation", referenced from:
__glfwPlatformWindowHovered in 000002.o
"_objc_msgSend$mouseLocationOutsideOfEventStream", referenced from:
__glfwPlatformSetCursorPos in 000002.o
_glfwSetInputMode in 000002.o
__glfwPlatformGetCursorPos in 000002.o
_glfwGetCursorPos in 000002.o
__glfwPlatformSetCursor in 000002.o
_updateCursorMode in 000002.o
"_objc_msgSend$mouseMoved:", referenced from:
-[GLFWContentView mouseDragged:] in 000002.o
-[GLFWContentView rightMouseDragged:] in 000002.o
-[GLFWContentView otherMouseDragged:] in 000002.o
"_objc_msgSend$mutableString", referenced from:
-[GLFWContentView unmarkText] in 000002.o
"_objc_msgSend$nextEventMatchingMask:untilDate:inMode:dequeue:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
__glfwPlatformDestroyWindow in 000002.o
_glfwPollEvents in 000002.o
__glfwPlatformPollEvents in 000002.o
__glfwPlatformWaitEvents in 000002.o
__glfwPlatformWaitEventsTimeout in 000002.o
"_objc_msgSend$objectAtIndexedSubscript:", referenced from:
-[GLFWContentView performDragOperation:] in 000002.o
"_objc_msgSend$objectForKeyedSubscript:", referenced from:
__glfwPollMonitorsNS in 000002.o
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$occlusionState", referenced from:
-[GLFWWindowDelegate windowDidChangeOcclusionState:] in 000002.o
"_objc_msgSend$operationNotAllowedCursor", referenced from:
__glfwPlatformCreateStandardCursor in 000002.o
"_objc_msgSend$orderFront:", referenced from:
_glfwCreateWindow in 000002.o
__glfwPlatformCreateWindow in 000002.o
__glfwPlatformShowWindow in 000002.o
_glfwShowWindow in 000002.o
"_objc_msgSend$orderOut:", referenced from:
__glfwPlatformDestroyWindow in 000002.o
_glfwHideWindow in 000002.o
__glfwPlatformHideWindow in 000002.o
"_objc_msgSend$otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:", referenced from:
_glfwPostEmptyEvent in 000002.o
__glfwPlatformPostEmptyEvent in 000002.o
-[GLFWApplicationDelegate applicationDidFinishLaunching:] in 000002.o
"_objc_msgSend$pathForResource:ofType:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$performSelector:", referenced from:
__glfwPlatformCreateStandardCursor in 000002.o
"_objc_msgSend$performSelector:withObject:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$pointingHandCursor", referenced from:
__glfwPlatformCreateStandardCursor in 000002.o
"_objc_msgSend$postEvent:atStart:", referenced from:
_glfwPostEmptyEvent in 000002.o
__glfwPlatformPostEmptyEvent in 000002.o
-[GLFWApplicationDelegate applicationDidFinishLaunching:] in 000002.o
"_objc_msgSend$readObjectsForClasses:options:", referenced from:
-[GLFWContentView performDragOperation:] in 000002.o
"_objc_msgSend$registerDefaults:", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$registerForDraggedTypes:", referenced from:
-[GLFWContentView initWithGlfwWindow:] in 000002.o
"_objc_msgSend$removeMonitor:", referenced from:
__glfwPlatformTerminate in 000002.o
"_objc_msgSend$removeObserver:", referenced from:
__glfwPlatformTerminate in 000002.o
"_objc_msgSend$removeObserver:name:object:", referenced from:
__glfwPlatformTerminate in 000002.o
"_objc_msgSend$removeTrackingArea:", referenced from:
-[GLFWContentView updateTrackingAreas] in 000002.o
"_objc_msgSend$requestUserAttention:", referenced from:
_glfwRequestWindowAttention in 000002.o
__glfwPlatformRequestWindowAttention in 000002.o
"_objc_msgSend$resizeLeftRightCursor", referenced from:
__glfwPlatformCreateStandardCursor in 000002.o
"_objc_msgSend$resizeUpDownCursor", referenced from:
__glfwPlatformCreateStandardCursor in 000002.o
"_objc_msgSend$run", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$screens", referenced from:
__glfwPollMonitorsNS in 000002.o
"_objc_msgSend$scrollingDeltaX", referenced from:
-[GLFWContentView scrollWheel:] in 000002.o
"_objc_msgSend$scrollingDeltaY", referenced from:
-[GLFWContentView scrollWheel:] in 000002.o
"_objc_msgSend$sendEvent:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
__glfwPlatformDestroyWindow in 000002.o
_glfwPollEvents in 000002.o
__glfwPlatformPollEvents in 000002.o
__glfwPlatformWaitEvents in 000002.o
__glfwPlatformWaitEventsTimeout in 000002.o
____glfwPlatformInit_block_invoke in 000002.o
...
"_objc_msgSend$separatorItem", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$set", referenced from:
__glfwPlatformSetCursorPos in 000002.o
__glfwPlatformSetCursor in 000002.o
_updateCursorMode in 000002.o
-[GLFWContentView cursorUpdate:] in 000002.o
"_objc_msgSend$setAcceptsMouseMovedEvents:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setActivationPolicy:", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$setAlphaValue:", referenced from:
_glfwSetWindowOpacity in 000002.o
__glfwPlatformSetWindowOpacity in 000002.o
"_objc_msgSend$setBackgroundColor:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setCollectionBehavior:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setContentAspectRatio:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
_glfwSetWindowAspectRatio in 000002.o
__glfwPlatformSetWindowAspectRatio in 000002.o
"_objc_msgSend$setContentMaxSize:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
_glfwSetWindowSizeLimits in 000002.o
__glfwPlatformSetWindowSizeLimits in 000002.o
"_objc_msgSend$setContentMinSize:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
_glfwSetWindowSizeLimits in 000002.o
__glfwPlatformSetWindowSizeLimits in 000002.o
"_objc_msgSend$setContentView:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setContentsScale:", referenced from:
__glfwPlatformCreateWindowSurface in 000002.o
-[GLFWContentView viewDidChangeBackingProperties] in 000002.o
"_objc_msgSend$setDelegate:", referenced from:
__glfwPlatformInit in 000002.o
__glfwPlatformCreateWindow in 000002.o
__glfwPlatformDestroyWindow in 000002.o
__glfwPlatformTerminate in 000002.o
"_objc_msgSend$setFrame:display:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
__glfwPlatformCreateWindow in 000002.o
__glfwPlatformSetWindowSize in 000002.o
-[GLFWWindowDelegate windowDidDeminiaturize:] in 000002.o
"_objc_msgSend$setFrameAutosaveName:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setFrameOrigin:", referenced from:
__glfwInputMonitor in 000002.o
__glfwPlatformSetWindowPos in 000002.o
_glfwSetWindowPos in 000002.o
"_objc_msgSend$setHasShadow:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setIgnoresMouseEvents:", referenced from:
_glfwCreateWindow in 000002.o
__glfwPlatformSetWindowMousePassthrough in 000002.o
_glfwSetWindowAttrib in 000002.o
"_objc_msgSend$setKeyEquivalentModifierMask:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$setLayer:", referenced from:
__glfwPlatformCreateWindowSurface in 000002.o
"_objc_msgSend$setLevel:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
__glfwPlatformCreateWindow in 000002.o
_glfwSetWindowAttrib in 000002.o
__glfwPlatformSetWindowFloating in 000002.o
"_objc_msgSend$setMainMenu:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$setMiniwindowTitle:", referenced from:
_glfwSetWindowTitle in 000002.o
__glfwPlatformSetWindowTitle in 000002.o
"_objc_msgSend$setOpaque:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setResizeIncrements:", referenced from:
_glfwSetWindowAspectRatio in 000002.o
__glfwPlatformSetWindowAspectRatio in 000002.o
"_objc_msgSend$setRestorable:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setServicesMenu:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$setString:", referenced from:
-[GLFWContentView unmarkText] in 000002.o
"_objc_msgSend$setString:forType:", referenced from:
_glfwSetClipboardString in 000002.o
__glfwPlatformSetClipboardString in 000002.o
"_objc_msgSend$setStyleMask:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
_glfwSetWindowAttrib in 000002.o
__glfwPlatformSetWindowResizable in 000002.o
__glfwPlatformSetWindowDecorated in 000002.o
"_objc_msgSend$setSubmenu:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$setTabbingMode:", referenced from:
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setTitle:", referenced from:
__glfwPlatformSetWindowMonitor in 000002.o
__glfwPlatformCreateWindow in 000002.o
_glfwSetWindowTitle in 000002.o
__glfwPlatformSetWindowTitle in 000002.o
"_objc_msgSend$setValues:forParameter:", referenced from:
__glfwCreateContextNSGL in 000002.o
_swapIntervalNSGL in 000002.o
"_objc_msgSend$setView:", referenced from:
__glfwCreateContextNSGL in 000002.o
"_objc_msgSend$setWantsBestResolutionOpenGLSurface:", referenced from:
__glfwCreateContextNSGL in 000002.o
"_objc_msgSend$setWantsLayer:", referenced from:
__glfwPlatformCreateWindowSurface in 000002.o
__glfwPlatformCreateWindow in 000002.o
"_objc_msgSend$setWindowsMenu:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$sharedApplication", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$standardUserDefaults", referenced from:
__glfwPlatformInit in 000002.o
"_objc_msgSend$stop:", referenced from:
-[GLFWApplicationDelegate applicationDidFinishLaunching:] in 000002.o
"_objc_msgSend$string", referenced from:
-[GLFWContentView insertText:replacementRange:] in 000002.o
"_objc_msgSend$stringForType:", referenced from:
__glfwPlatformGetClipboardString in 000002.o
"_objc_msgSend$stringWithFormat:", referenced from:
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$stringWithUTF8String:", referenced from:
_glfwSetClipboardString in 000002.o
__glfwPlatformSetClipboardString in 000002.o
__glfwPlatformCreateWindow in 000002.o
_glfwSetWindowTitle in 000002.o
__glfwPlatformSetWindowTitle in 000002.o
-[GLFWApplicationDelegate applicationWillFinishLaunching:] in 000002.o
"_objc_msgSend$types", referenced from:
__glfwPlatformGetClipboardString in 000002.o
"_objc_msgSend$unhide", referenced from:
__glfwPlatformSetCursorPos in 000002.o
__glfwPlatformSetCursor in 000002.o
_updateCursorMode in 000002.o
-[GLFWContentView cursorUpdate:] in 000002.o
-[GLFWContentView mouseExited:] in 000002.o
"_objc_msgSend$unsignedIntValue", referenced from:
__glfwPollMonitorsNS in 000002.o
"_objc_msgSend$update", referenced from:
-[GLFWApplicationDelegate applicationDidChangeScreenParameters:] in 000002.o
-[GLFWWindowDelegate windowDidResize:] in 000002.o
-[GLFWWindowDelegate windowDidMove:] in 000002.o
-[GLFWContentView updateLayer] in 000002.o
"_objc_msgSend$updateTrackingAreas", referenced from:
-[GLFWContentView initWithGlfwWindow:] in 000002.o
"_objc_msgSend$valueForKey:", referenced from:
__glfwPollMonitorsNS in 000002.o
"_objc_msgSend$visibleFrame", referenced from:
__glfwPlatformGetMonitorWorkarea in 000002.o
"_objc_msgSend$windowNumber", referenced from:
__glfwPlatformWindowHovered in 000002.o
"_objc_msgSend$windowNumberAtPoint:belowWindowWithWindowNumber:", referenced from:
__glfwPlatformWindowHovered in 000002.o
"_objc_msgSend$zoom:", referenced from:
__glfwPlatformCreateWindow in 000002.o
_glfwRestoreWindow in 000002.o
__glfwPlatformRestoreWindow in 000002.o
_glfwMaximizeWindow in 000002.o
__glfwPlatformMaximizeWindow in 000002.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Looks like you tried to cross-compile with just using GOARCH, of course, that will not work. And any time you try to cross-compile Go will disable cgo, you need to explicitly enable it again with CGO_ENABLED=1. And, you must use a C compiler for that architecture, i.e. to set CC. That is the reason for those "undefined: Vector2 errors". For the first error, no idea, it would be helpful to send more information. It works here, even when cross-compiling from Linux, and also GH actions don't report any problems:
$ CGO_ENABLED=1 CC=aarch64-apple-darwin21.1-clang GOOS=darwin GOARCH=arm64 go build -ldflags "-linkmode external -s -w"
$ file basic_window
basic_window: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS>
You can try with -ldflags "-linkmode external", though not sure why that would be needed, something looks wrong with your linker.