How to Static Link with Golang #2175
Unanswered
realchandan
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Please follow our doc to.build.static libs, and copy all generated libs. There are more than 5 libs |
Beta Was this translation helpful? Give feedback.
2 replies
-
Would you mind sharing more error info? Otherwise, it is not possible for us to know what bad things have happened.
How did you get sub Also, what exactly are the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there,
Can you provide some guidance on how to static link with Golang?
I've tried three approaches so far but haven't been able to static link the binary.
Approach 1:
I copied the
onnxruntime.lib
andsherpa-onnx-c-api.lib
to the same folder as mymain.go
file and tried to build usinggo build
, but the resulting binary still required.dll
files to run.Approach 2:
I created a submodule called
sherpa_wrapper
and did the following:I imported and called
InitSherpa
in my main program, but this didn't work either.Approach 3:
I cloned
https://github.com/k2-fsa/sherpa-onnx-go
locally and modified thego.mod
file to point to:replace github.com/k2-fsa/sherpa-onnx-go => ./local_sherpa-onnx-go
Inside
local_sherpa-onnx-go
, I pointed itsgo.mod
to:replace github.com/k2-fsa/sherpa-onnx-go-windows => ./local_sherpa-onnx-go-windows
In the
local_sherpa-onnx-go-windows
folder, I pasted the.lib
files in its root.But I'm still unable to make it work.
Can you provide some guidance on how to do it?
Beta Was this translation helpful? Give feedback.
All reactions