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

How does this reference C's library #1

Open
lirui-dot opened this issue Nov 15, 2021 · 1 comment
Open

How does this reference C's library #1

lirui-dot opened this issue Nov 15, 2021 · 1 comment

Comments

@lirui-dot
Copy link

No description provided.

@Xmister
Copy link
Owner

Xmister commented Nov 15, 2021

You can use environment variables for linking and including, e.g.:

Simple:

export CGO_LDFLAGS="-lsmb2"

Cross-compiling for android:

export CGO_LDFLAGS="-L/opt/android-sdk-linux/ndk-bundle/sysroot/lib -lsmb2" \
export CGO_CFLAGS="-D__ANDROID_API__=21 -I/opt/android-sdk-linux/ndk-bundle/sysroot/include -I/opt/android-sdk-linux/ndk-bundle/sysroot/include/smb2" \

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

No branches or pull requests

2 participants