繁体   English   中英

如何在Windows上使用goav的头文件设置golang

[英]How do you set up golang on windows with the header files for goav

我正在尝试在Windows上编译goav,到目前为止,我已经在MSYS2中编译了ffmpeg库,并将这些包链接到:

set PKG_CONFIG_PATH=%~dp0FFmpeg\libavformat;%~dp0FFmpeg\libavcodec;%~dp0FFmpeg\libavutil;%~dp0FFmpeg\libswresample;

哪个有效!

但是,这是现在的问题:

# github.com/giorgisio/goav/avcodec
source\src\github.com\giorgisio\goav\avcodec\avcodec.go:14:34: fatal error: libavformat/avformat.h: No such file or directory
 //#include <libavformat/avformat.h>

编译时,Golang找不到avformat.h(我假设其他ffmpeg头文件,但编译已终止)。

我怎么知道这些文件在哪里? 我已经检查过了,它们在PKG_CONFIG_PATH中描述的文件夹中,但是我想它不在那儿寻找它们。

旁注:我看到在基于linux-debian的系统上,我只需要执行apt-get install libavformat-dev但我想在Windows上进行编译。

解决我的问题的方法是在构建之前设置CGO_CFLAGS环境变量,以告诉编译器ffmpeg的包含文件在哪里:

@set CGO_CFLAGS=-IC:\path\to\FFmpeg\

...我的项目仍未建立,但不再显示该错误

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM