srs-librtmp icon indicating copy to clipboard operation
srs-librtmp copied to clipboard

cgo srs_librtmp.h

Open moneyzmey opened this issue 7 years ago • 0 comments

Hi, is it possible use your lib, with cgo ?

Actually i have a problem with it.

code sample:

package main

/*
#include "srs_librtmp.h"
*/
import "C"

func test(){
	var url *C.char = C.CString("rtmp://a.rtmp.youtube.com/live2")

	r:= C.srs_rtmp_create(url)
	C.srs_rtmp_handshake(r)

}

func main(){
	test()
}

output:

# command-line-arguments
Undefined symbols for architecture x86_64:
  "_srs_rtmp_create", referenced from:
      __cgo_c2568fdecd5f_Cfunc_srs_rtmp_create in main.cgo2.o
     (maybe you meant: __cgo_c2568fdecd5f_Cfunc_srs_rtmp_create)
  "_srs_rtmp_handshake", referenced from:
      __cgo_c2568fdecd5f_Cfunc_srs_rtmp_handshake in main.cgo2.o
     (maybe you meant: __cgo_c2568fdecd5f_Cfunc_srs_rtmp_handshake)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

moneyzmey avatar Jan 31 '18 11:01 moneyzmey