<div dir="ltr"><div>hello,</div><div><br></div><div>i am installing essentia (<a href="https://github.com/MTG/essentia/issues/1190">https://github.com/MTG/essentia/issues/1190</a>) for macos and xcode. after finishing the installation process, i was unable to build essentia because i am missing libavformat.56.dylib. i downloaded ffmpeg "Nash," which includes libavformat.56.dylib, but i could not configure this version of ffmpeg for obvious reasons. therefore, i tried to make libavformat in terminal using the Makefile. unfortunately, although there is a Makefile, i received this output from terminal:<br><br><span style="background-color:rgb(159,197,232)">Makefile:1: ../config.mak: No such file or directory<br>make: *** No rule to make target `../config.mak'.  Stop.</span></div><div><br></div><div>because i was unable to configure the contents of the libavformat folder, i tried to create a dylib using the .c files using this method: <a href="https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/CreatingDynamicLibraries.html">https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/CreatingDynamicLibraries.html</a></div><div><br></div><div>i ran a test using the gcc command, which looks promising only because it seems like the process itself works. here is my console output:<br><br><span style="background-color:rgb(159,197,232)">banana.ash@bananaash-2 libavformat % gcc -dynamiclib 4xm.c a64.c aacdec.c ac3dec.c act.c adp.c adtsenc.c adxdec.c aea.c afc.c aiffdec.c aiffenc.c -o libavformat.56.dylib -current_version 1.0 -compatibility_version 1.0<br>In file included from 4xm.c:32:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from 4xm.c:32:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>In file included from 4xm.c:33:<br>In file included from ./internal.h:26:<br>./os_support.h:30:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>3 errors generated.<br>a64.c:23:10: fatal error: 'libavcodec/bytestream.h' file not found<br>#include "libavcodec/bytestream.h"<br>         ^~~~~~~~~~~~~~~~~~~~~~~~~<br>1 error generated.<br>In file included from aacdec.c:24:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from aacdec.c:24:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>In file included from aacdec.c:25:<br>In file included from ./internal.h:26:<br>./os_support.h:30:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>3 errors generated.<br>In file included from ac3dec.c:24:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from ac3dec.c:24:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>ac3dec.c:31:5: error: use of undeclared identifier 'AC3HeaderInfo'<br>    AC3HeaderInfo *phdr = NULL;<br>    ^<br>ac3dec.c:31:20: error: use of undeclared identifier 'phdr'<br>    AC3HeaderInfo *phdr = NULL;<br>                   ^<br>ac3dec.c:32:5: error: use of undeclared identifier 'GetBitContext'<br>    GetBitContext gbc;<br>    ^<br>ac3dec.c:55:17: error: implicit declaration of function 'init_get_bits' is invalid in C99 [-Werror,-Wimplicit-function-declaration]<br>                init_get_bits(&gbc, buf3, 54);<br>                ^<br>ac3dec.c:55:32: error: use of undeclared identifier 'gbc'<br>                init_get_bits(&gbc, buf3, 54);<br>                               ^<br>ac3dec.c:57:17: error: implicit declaration of function 'init_get_bits' is invalid in C99 [-Werror,-Wimplicit-function-declaration]<br>                init_get_bits(&gbc, buf2, 54);<br>                ^<br>ac3dec.c:57:32: error: use of undeclared identifier 'gbc'<br>                init_get_bits(&gbc, buf2, 54);<br>                               ^<br>ac3dec.c:58:16: error: implicit declaration of function 'avpriv_ac3_parse_header2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]<br>            if(avpriv_ac3_parse_header2(&gbc, &phdr) < 0)<br>               ^<br>ac3dec.c:58:16: note: did you mean 'av_ac3_parse_header'?<br>/usr/local/include/libavcodec/ac3_parser.h:32:5: note: 'av_ac3_parse_header' declared here<br>int av_ac3_parse_header(const uint8_t *buf, size_t size,<br>    ^<br>ac3dec.c:58:42: error: use of undeclared identifier 'gbc'<br>            if(avpriv_ac3_parse_header2(&gbc, &phdr) < 0)<br>                                         ^<br>ac3dec.c:58:48: error: use of undeclared identifier 'phdr'<br>            if(avpriv_ac3_parse_header2(&gbc, &phdr) < 0)<br>                                               ^<br>ac3dec.c:60:23: error: use of undeclared identifier 'phdr'<br>            if(buf2 + phdr->frame_size > end)<br>                      ^<br>ac3dec.c:63:17: error: implicit declaration of function 'av_assert0' is invalid in C99 [-Werror,-Wimplicit-function-declaration]<br>                av_assert0(phdr->frame_size <= sizeof(buf3));<br>                ^<br>ac3dec.c:63:28: error: use of undeclared identifier 'phdr'<br>                av_assert0(phdr->frame_size <= sizeof(buf3));<br>                           ^<br>ac3dec.c:64:28: error: use of undeclared identifier 'phdr'<br>                for(i=8; i<phdr->frame_size; i+=2) {<br>                           ^<br>ac3dec.c:69:60: error: use of undeclared identifier 'gbc'<br>            if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, gbc.buffer + 2, phdr->frame_size - 2))<br>                                                           ^<br>ac3dec.c:69:76: error: use of undeclared identifier 'phdr'<br>            if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, gbc.buffer + 2, phdr->frame_size - 2))<br>                                                                           ^<br>ac3dec.c:71:17: error: use of undeclared identifier 'phdr'<br>            if (phdr->bitstream_id > 10)<br>                ^<br>fatal error: too many errors emitted, stopping now [-ferror-limit=]<br>20 errors generated.<br>In file included from act.c:21:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from act.c:21:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>In file included from act.c:22:<br>In file included from ./riff.h:33:<br>In file included from ./internal.h:26:<br>./os_support.h:30:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>3 errors generated.<br>In file included from adp.c:24:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from adp.c:24:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>In file included from adp.c:25:<br>In file included from ./internal.h:26:<br>./os_support.h:30:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>3 errors generated.<br>adtsenc.c:23:10: fatal error: 'libavcodec/get_bits.h' file not found<br>#include "libavcodec/get_bits.h"<br>         ^~~~~~~~~~~~~~~~~~~~~~~<br>1 error generated.<br>In file included from adxdec.c:27:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from adxdec.c:27:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>In file included from adxdec.c:28:<br>In file included from ./internal.h:26:<br>./os_support.h:30:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>3 errors generated.<br>In file included from aea.c:25:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from aea.c:25:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>aea.c:103:23: error: implicit declaration of function 'NULL_IF_CONFIG_SMALL' is invalid in C99 [-Werror,-Wimplicit-function-declaration]<br>    .long_name      = NULL_IF_CONFIG_SMALL("MD STUDIO audio"),<br>                      ^<br>aea.c:103:23: warning: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Wint-conversion]<br>    .long_name      = NULL_IF_CONFIG_SMALL("MD STUDIO audio"),<br>                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>aea.c:103:23: error: initializer element is not a compile-time constant<br>    .long_name      = NULL_IF_CONFIG_SMALL("MD STUDIO audio"),<br>                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>1 warning and 4 errors generated.<br>In file included from afc.c:23:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from afc.c:23:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>In file included from afc.c:24:<br>In file included from ./internal.h:26:<br>./os_support.h:30:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>3 errors generated.<br>In file included from aiffdec.c:25:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from aiffdec.c:25:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>In file included from aiffdec.c:26:<br>In file included from ./internal.h:26:<br>./os_support.h:30:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>3 errors generated.<br>In file included from aiffenc.c:26:<br>./avformat.h:1847:16: error: redefinition of 'AVPacketList'<br>typedef struct AVPacketList {<br>               ^<br>/usr/local/include/libavcodec/packet.h:404:16: note: previous definition is here<br>typedef struct AVPacketList {<br>               ^<br>In file included from aiffenc.c:26:<br>./avformat.h:1850:3: error: typedef redefinition with different types ('struct (anonymous struct at ./avformat.h:1847:16)' vs 'struct AVPacketList')<br>} AVPacketList;<br>  ^<br>/usr/local/include/libavcodec/packet.h:407:3: note: previous definition is here<br>} AVPacketList;<br>  ^<br>In file included from aiffenc.c:27:<br>In file included from ./internal.h:26:<br>./os_support.h:30:10: fatal error: 'config.h' file not found<br>#include "config.h"<br>         ^~~~~~~~~~<br>3 errors generated.</span></div><div><br></div><div>i have some questions about this approach:</div><div><br></div><div>1. assuming i used this method to create a dylib, would it be save or valid to use?</div><div>2. the ggc command includes .c files, but there are .h files in the folder as well. do i ned to link them? if so, how? <br></div><div>3. are there less adhoc methods to obtain a libav.56.dylib file?</div><div><br></div><div>thanks in advance.</div><div><br></div><div>tk<br></div><div><br></div><div><br></div></div>