mkvserver_mk2
mkvserver_mk2 copied to clipboard
Error on compiling
Good afternoon
Hello Brother
I am trying to compile but the following error is being returned, can you help me please
$ make
#cc -g -Wall `pkg-config --cflags libavformat libavcodec libavutil` `pkg-config --libs libavformat libavcodec libavutil` -pthread -o server segment.o buffer.o publisher.o server2.c
cc -g -Wall `pkg-config --cflags libavformat libavcodec libavutil` -pthread -o server segment.o buffer.o publisher.o server2.c `pkg-config --libs libavformat libavcodec libavutil`
server2.c: In function ‘write_segment’:
server2.c:225:9: warning: implicit declaration of function ‘avio_context_free’ [-Wimplicit-function-declaration]
avio_context_free(&avio_ctx);
^~~~~~~~~~~~~~~~~
server2.c: In function ‘accept_thread’:
server2.c:301:66: warning: passing argument 4 of ‘av_opt_get’ from incompatible pointer type [-Wincompatible-pointer-types]
av_opt_get(client, "method", AV_OPT_SEARCH_CHILDREN, &method);
^
In file included from server2.c:8:0:
/usr/include/x86_64-linux-gnu/libavutil/opt.h:736:5: note: expected ‘uint8_t ** {aka unsigned char **}’ but argument is of type ‘char **’
int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
^~~~~~~~~~
server2.c:302:68: warning: passing argument 4 of ‘av_opt_get’ from incompatible pointer type [-Wincompatible-pointer-types]
av_opt_get(client, "resource", AV_OPT_SEARCH_CHILDREN, &resource);
^
In file included from server2.c:8:0:
/usr/include/x86_64-linux-gnu/libavutil/opt.h:736:5: note: expected ‘uint8_t ** {aka unsigned char **}’ but argument is of type ‘char **’
int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
^~~~~~~~~~
/tmp/cccoshgL.o: In function `write_segment':
/home/marcio/dados/mkvserver_mk2/server2.c:225: undefined reference to `avio_context_free'
collect2: error: ld returned 1 exit status
Makefile:11: recipe for target 'server' failed
make: *** [server] Error 1
Hope I'm not resurrected a too old of an issue.
This error messages shows that during the linking (attaching the libraries to the binary) in the compilation process, it couldn't find the avformat library that comes with ffmpeg.
In order to solve this try :
- To run this command
pkg-config --libs libaformat
. If nothing shows up, try to identify where the .pc for libavformat are.- To find the .pc you can try to look in /usr/local/lib/pkgconfig if you fin libavformat.pc then type
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
- To find the .pc you can try to look in /usr/local/lib/pkgconfig if you fin libavformat.pc then type
If nothing is here, then try to configure ffmpeg by following tutorials online or asking on the irc. But typically just run
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg && cd ffmpeg && ./configure [OPTIONS YOU NEED] && sudo make && sudo make install prefix=/usr/local/
[OPTIONS YOU NEED] = plugins you need such as --enable-libx264 --disable-x86asm and so on