Skip to content

Instantly share code, notes, and snippets.

@dazuiba
Last active March 15, 2024 09:21
Show Gist options
  • Save dazuiba/76f5f3d3e69f15d4cd7b35e8dc1eb0aa to your computer and use it in GitHub Desktop.
Save dazuiba/76f5f3d3e69f15d4cd7b35e8dc1eb0aa to your computer and use it in GitHub Desktop.
path
# golang 编译cgo时需要的环境变量
export LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -L/usr/local/homebrew/opt/[email protected]/lib"
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" # Needed for Rust compilation and linking
export CPATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
export CGO_LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
export CGO_CFLAGS="-F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -Wno-nullability-completeness"
export GOROOT="/usr/local/go"
export GOBIN=~/go_bin
export PATH=$PATH:$GOBIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment