MAC OS用ffmpeg编译代码出现的Undefined symbols for architecture x86_64: "_CGLGetCurrentContext", referenced
来源:互联网 发布:软件开发包含什么 编辑:程序博客网 时间:2024/06/06 02:23
编译的代码在这里:http://blog.csdn.net/leixiaohua1020/article/details/50618190。
这个代码在MAC OS 10.12,ffmpeg 3.2下没有编译成功。
clang++ simplest_filter_video_pure.cpp -g -o simplest_ffmpeg_video_pure \-framework Cocoa -I/usr/local/include -L/usr/local/lib/ -lavformat -lavcodec -lavutil -lavfilter -lswscale
可能出现类似下面的错误提醒,会有很多:
Undefined symbols for architecture x86_64: "_CGLGetCurrentContext", referenced from: _init in libavfilter.a(vf_coreimage.o)ld: symbol(s) not found for architecture x86_64
这类问题一般都是库或者framework没有倒入进去。比如上面的这个提醒就是OpenGL的framework没有放进去的原因。
还有其他可能是videotoolbox这样的库没有倒入进去。其实只需要一个个找,就能找到缺了什么东西。
最后编译脚本如下:
clang++ simplest_filter_video_pure.cpp -g -o simplest_ffmpeg_video_pure \-framework OpenGL -framework AppKit -framework Security -framework CoreFoundation -framework CoreVideo -framework CoreMedia -framework QuartzCore -framework CoreFoundation -framework VideoDecodeAcceleration -framework Cocoa -framework AudioToolbox -framework VideoToolbox -I/usr/local/include -L/usr/local/lib/ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/ \-lz -lc++ -liconv -lbz2 -lavformat -lavcodec -lavutil -lavfilter -lswscale -lpostproc -l swresample
最后这个代码有enum这里,需要改一下,成下面的样子:
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
还有一个地方也需要改下:
AVFilter *buffersink = avfilter_get_by_name("buffersink");
不要加ff。
最后需要提醒新手,播放yuv的时候,需要注意设置宽高度,否则花屏。
下面是用boxlur滤镜处理的结果:
0 0
- MAC OS用ffmpeg编译代码出现的Undefined symbols for architecture x86_64: "_CGLGetCurrentContext", referenced
- mac出现clang error Undefined symbols for architecture x86_64
- Mac下Clion编译错误:Undefined symbols for architecture x86_64
- Xcode 编译 Undefined symbols for architecture x86_64:
- 编译CImg时,Undefined symbols for architecture x86_64的问题解决
- osX下编译c++程序出现Undefined symbols for architecture x86_64的原因及解决
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_MAMapServices", referenced from: o
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_JSContext", referenced from: ...........
- Undefined symbols for architecture x86_64: "_sqlite3_close", referenced from:
- Undefined symbols for architecture x86_64: "_SDL_main", referenced from:报错
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_WKWebView", referenced from: objc-
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_JSContext", referenced from: ...........
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_LMZArrayDataSource", referenced from:
- Undefined symbols for architecture x86_64:"xxxxxx", referenced from:
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_EditRecordViewController", referenced fr
- Undefined symbols for architecture x86_64: "_res_9_setservers", referenced from: _setup_dns_
- Undefined symbols for architecture x86_64:
- svn设置忽略文件或者文件夹(目录)
- Gogland IDE Run/Debug Configurations 配置说明
- Spring框架:Spring容器详解
- UML中的九种图
- 母函数模板详解
- MAC OS用ffmpeg编译代码出现的Undefined symbols for architecture x86_64: "_CGLGetCurrentContext", referenced
- mongodb数据库备份和利用shell脚本编写
- 7.多态
- Byobu快捷键汇总
- (chrome)Adobe Flash 无法正常使用
- linux命令 - ln - 创建和删除软、硬链接
- 谷歌Google被墙打不开,找不到技术性资料怎么办?
- TurtleWorld
- ThreadLocal原理与源码分析