How do you statically link a c library in go using cgo?

前端 未结 4 1665
感情败类
感情败类 2020-11-28 23:22

So there\'s a bunch of stuff on the group that suggests you can do this in go (although not on the cgo documentation):

package bridge

import \"fmt\"

// #cg         


        
4条回答
  •  猫巷女王i
    2020-11-29 00:05

    Try:

    // #cgo LDFLAGS: -l/Users/doug/projects/c/go-bridge/build/libgb.a
    

    You missed the -l in the LDFLAGS directive.

提交回复
热议问题