Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on compiling #23

Open
naazguu opened this issue Jul 18, 2019 · 1 comment
Open

Error on compiling #23

naazguu opened this issue Jul 18, 2019 · 1 comment

Comments

@naazguu
Copy link

naazguu commented Jul 18, 2019

Good afternoon

Hello Brother

I am trying to compile but the following error is being returned, can you help me please

Captura de tela de 2019-07-18 16-22-59

$ 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
@Radiateurs
Copy link

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"

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants