Cannot debug on Mac OS
Hi,
I'm using GoLand writing some golang project on MacOS, the project can be compiled and run well, but when I hit the "Debug" button, it will complain "compilation failure" with the following error. I have tried to use "xcode-select --install", and tried copy the /Application/Developer/../CoreFoundation.framework to "/usr/local/include", but nothing works.
Could anyone help me on this? Thanks!
============
# crypto/x509
/usr/local/go/src/crypto/x509/root_cgo_darwin.go:16:10: fatal error: 'CoreFoundation/CoreFoundation.h' file not found
#include <CoreFoundation/CoreFoundation.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
============
Go version: go1.11.2
MacOS version: macOS 10.14.2
GoLand 2018.3.1
Build #GO-183.4588.42, built on December 3, 2018
Licensed to GoLand Evaluator
Expiration date: January 6, 2019
JRE: 1.8.0_152-release-1343-b16 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.2
请先登录再写评论。
It looks like your XCode installation is somehow broken. XCode is needed in order for the Go compiler to compile the code and Delve to be able to debug it.
Please see this thread https://github.com/golang/go/issues/16970 on how to determine what's broken and how to fix it.
Thanks. I have got this fixed by the following steps:
Copy/Merge all of the Framework files under /Library/Developer/CommandLineTools/SDKs/MacOS10.14.SDK/System/Library/Frameworks to /System/Library/Frameworks.
It seems the new version of CommandLineTools is not setting up the link correctly.