在Go语言中是否有mmseg,或者我可以从Go中调用自定义的C函数吗?

huangapple go评论91阅读模式
英文:

Is there mmseg in Go or can I call a self-defined C function from Go?

问题

我想在Go中像其他语言一样使用mmseg,例如,在Python中,您可以使用pymmseg。

那么,是否有类似的Go包?

或者,我如何从Go调用C函数?
或者,我如何像在Python中那样从Go调用共享库(*.so)?

英文:

I want to use mmseg in Go as in other languages, for example, in python you can use pymmseg

So, is there is a similar Go package?

Or, how can I call the C functions from Go?
Or, how can I call shared library (*.so) from Go like in python?

答案1

得分: 1

你可以按照这个教程中描述的方法使用C库:

http://cheesesun.blogspot.de/2009/12/basic-cgo.html

还有:

http://siganakis.com/linking-c-libraries-with-go-lang-and-stdc99

或者你可以看看这个库:

https://github.com/awsong/MMSEGO

它是用于中文的,但你可能可以用它来放置你自己的算法。

英文:

you can call use C Libs as described in this tutorial:

http://cheesesun.blogspot.de/2009/12/basic-cgo.html

and:

http://siganakis.com/linking-c-libraries-with-go-lang-and-stdc99

or you may have a look at this library:

https://github.com/awsong/MMSEGO

its for chinese, but you may could use it to put your own algorithm there.

答案2

得分: 0

使用cgo从Go中调用C代码。

命令cgo

C?Go?Cgo!

英文:

Use cgo to call C code from Go.

Command cgo

C? Go? Cgo!

huangapple
  • 本文由 发表于 2012年11月29日 15:49:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/13621095.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定