3d0c/gmf

Cannot build by golang 1.3

Closed this issue · 4 comments

system: Mac OSX 10.9
go version: go1.3 darwin/amd64
ffmpeg version 2.1.4 Copyright (c) 2000-2014 the FFmpeg developers
built on Mar 3 2014 09:09:13 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libavresample 1. 1. 0 / 1. 1. 0
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100

when run "go run encoding.go" show some error. When use golang 1.2 is can work.but have other bug.

github.com/3d0c/gmf

../avio.go:89: cannot use _Cfunc_avio_alloc_context(this.buffer, C.int(IO_BUFFER_SIZE), 0, unsafe.Pointer(ctx.avCtx), ptrRead, ptrWrite, ptrSeek) (type *C.struct_AVIOContext) as type *C.AVIOContext in assignment
../codec.go:49: cannot use _Cfunc_avcodec_find_decoder_by_name(cname) (type *C.struct_AVCodec) as type *C.AVCodec in assignment
../codec.go:53: cannot use _Cfunc_avcodec_find_decoder(uint32(i.(int))) (type *C.struct_AVCodec) as type *C.AVCodec in assignment
../codec.go:75: cannot use _Cfunc_avcodec_find_encoder_by_name(cname) (type *C.struct_AVCodec) as type *C.AVCodec in assignment
../codec.go:79: cannot use _Cfunc_avcodec_find_encoder(uint32(i.(int))) (type *C.struct_AVCodec) as type *C.AVCodec in assignment
../codecCtx.go:94: cannot use codec.avCodec (type *C.AVCodec) as type *C.struct_AVCodec in argument to _Cfunc_avcodec_alloc_context3
../codecCtx.go:99: cannot use codec.avCodec (type *C.AVCodec) as type *C.struct_AVCodec in argument to _Cfunc_avcodec_get_context_defaults3
../codecCtx.go:101: cannot use codecctx (type *C.struct_AVCodecContext) as type *C.AVCodecContext in assignment
../codecCtx.go:173: cannot use this.avCodecCtx (type *C.AVCodecContext) as type *C.struct_AVCodecContext in argument to _Cfunc_avcodec_open2
../codecCtx.go:173: cannot use this.codec.avCodec (type *C.AVCodec) as type *C.struct_AVCodec in argument to _Cfunc_avcodec_open2
../codecCtx.go:173: too many errors

3d0c commented

Fixed by 4a4dfd7

Thankyou for fix this bug.

Thankyou very much

Still facing the same issue:

github.com/3d0c/gmf

./avio.go:91: cannot use _Cfunc_avio_alloc_context(this.buffer, _Ctype_int(IO_BUFFER_SIZE), 0, unsafe.Pointer(ctx.avCtx), ptrRead, ptrWrite, ptrSeek) (type *_Ctype_AVIOContext) as type *_Ctype_struct_AVIOContext in assignment
./codec.go:50: cannot use _Cfunc_avcodec_find_decoder_by_name(cname) (type *_Ctype_AVCodec) as type *_Ctype_struct_AVCodec in assignment
./codec.go:54: cannot use _Cfunc_avcodec_find_decoder(uint32(i.(int))) (type *_Ctype_AVCodec) as type *_Ctype_struct_AVCodec in assignment
./codec.go:76: cannot use _Cfunc_avcodec_find_encoder_by_name(cname) (type *_Ctype_AVCodec) as type *_Ctype_struct_AVCodec in assignment
./codec.go:80: cannot use _Cfunc_avcodec_find_encoder(uint32(i.(int))) (type *_Ctype_AVCodec) as type *_Ctype_struct_AVCodec in assignment
./codecCtx.go:96: cannot use codec.avCodec (type *_Ctype_struct_AVCodec) as type *_Ctype_AVCodec in function argument
./codecCtx.go:101: cannot use codec.avCodec (type *_Ctype_struct_AVCodec) as type *_Ctype_AVCodec in function argument
./codecCtx.go:103: cannot use codecctx (type *_Ctype_AVCodecContext) as type *_Ctype_struct_AVCodecContext in assignment
./codecCtx.go:175: cannot use this.avCodecCtx (type *_Ctype_struct_AVCodecContext) as type *_Ctype_AVCodecContext in function argument
./codecCtx.go:175: cannot use this.codec.avCodec (type *_Ctype_struct_AVCodec) as type *_Ctype_AVCodec in function argument
./codecCtx.go:175: too many errors

Go version is
go1.2.2 linux/amd64

I am also using latest gmf from git.

3d0c commented

Looks like you're trying to build an old version of gmf. Ensure, that you've got current master branch.