macOS Linking error running with `dlv debug`
adammw opened this issue · comments
Adam Malcontenti-Wilson commented
Please answer the following before submitting your issue:
- What version of Delve are you using (
dlv version
)?1.22.1
- What version of Go are you using? (
go version
)?go version go1.22.2 darwin/amd64
- What operating system and processor architecture are you using?
Mac OS 14.4.1 (23E224)
amd64
Reproduction Steps
- Clone Sample code - Gist https://gist.github.com/adammw/22fbc0c16e40cfd1241a874e3914a89d
- Run
go mod init
to create go.mod file - Run
go build .
and see that it succeeds - Run
go run .
and see that it runs correctly:
result=65280
- Run
dlv debug .
and see that it errors out at the linking step:
/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running cc failed: exit status 1
Undefined symbols for architecture x86_64:
"_decode_int32", referenced from:
_sample_func in 000002.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
exit status 1