Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When run examples/ch2.1/hello-03/main.go , an error occurred #598

Open
cag2050 opened this issue Sep 3, 2022 · 0 comments
Open

When run examples/ch2.1/hello-03/main.go , an error occurred #598

cag2050 opened this issue Sep 3, 2022 · 0 comments
Assignees
Labels

Comments

@cag2050
Copy link

cag2050 commented Sep 3, 2022

Description of problem

when run https://github.com/chai2010/advanced-go-programming-book/blob/master/examples/ch2.1/hello-03/main.go, an error occurred:

GOROOT=/usr/local/go #gosetup
GOPATH=/Users/cag2050/go #gosetup
/usr/local/go/bin/go build -o /private/var/folders/bs/c1rv5w6n0cn77fp62sj3hzhh0000gp/T/GoLand/___5go_build_main_go /Users/cag2050/Documents/GoLandProjects/advanced-go-programming-book/examples/ch2.1/hello-03/main.go #gosetup
# command-line-arguments
Undefined symbols for architecture x86_64:
  "_SayHello", referenced from:
      __cgo_42939a32e160_Cfunc_SayHello in _x002.o
     (maybe you meant: __cgo_42939a32e160_Cfunc_SayHello)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected result

do not have error

Actual result

Further information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants