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

Building on macOS produces error #277

Open
valeriyvan opened this issue Mar 9, 2024 · 3 comments
Open

Building on macOS produces error #277

valeriyvan opened this issue Mar 9, 2024 · 3 comments

Comments

@valeriyvan
Copy link

make ends with following:

...
CC	libavutil/display.o
CC	libavutil/downmix_info.o
CC	libavutil/error.o
CC	libavutil/eval.o
CC	libavutil/fifo.o
CC	libavutil/file.o
CC	libavutil/file_open.o
CC	libavutil/float_dsp.o
CC	libavutil/frame.o
CC	libavutil/hmac.o
libavutil/hmac.c:61:21: error: incompatible function pointer types assigning to 'void (*)(void *)' from 'void (struct AVMD5 *)' [-Wincompatible-function-pointer-types]
        c->init     = av_md5_init;
                    ^ ~~~~~~~~~~~
libavutil/hmac.c:62:21: error: incompatible function pointer types assigning to 'void (*)(void *, const uint8_t *, int)' (aka 'void (*)(void *, const unsigned char *, int)') from 'void (struct AVMD5 *, const uint8_t *, const int)' (aka 'void (struct AVMD5 *, const unsigned char *, const int)') [-Wincompatible-function-pointer-types]
        c->update   = av_md5_update;
                    ^ ~~~~~~~~~~~~~
libavutil/hmac.c:63:21: error: incompatible function pointer types assigning to 'void (*)(void *, uint8_t *)' (aka 'void (*)(void *, unsigned char *)') from 'void (struct AVMD5 *, uint8_t *)' (aka 'void (struct AVMD5 *, unsigned char *)') [-Wincompatible-function-pointer-types]
        c->final    = av_md5_final;
                    ^ ~~~~~~~~~~~~
libavutil/hmac.c:70:21: error: incompatible function pointer types assigning to 'void (*)(void *, const uint8_t *, int)' (aka 'void (*)(void *, const unsigned char *, int)') from 'void (struct AVSHA *, const uint8_t *, unsigned int)' (aka 'void (struct AVSHA *, const unsigned char *, unsigned int)') [-Wincompatible-function-pointer-types]
        c->update   = av_sha_update;
                    ^ ~~~~~~~~~~~~~
libavutil/hmac.c:71:21: error: incompatible function pointer types assigning to 'void (*)(void *, uint8_t *)' (aka 'void (*)(void *, unsigned char *)') from 'void (struct AVSHA *, uint8_t *)' (aka 'void (struct AVSHA *, unsigned char *)') [-Wincompatible-function-pointer-types]
        c->final    = av_sha_final;
                    ^ ~~~~~~~~~~~~
libavutil/hmac.c:78:21: error: incompatible function pointer types assigning to 'void (*)(void *, const uint8_t *, int)' (aka 'void (*)(void *, const unsigned char *, int)') from 'void (struct AVSHA *, const uint8_t *, unsigned int)' (aka 'void (struct AVSHA *, const unsigned char *, unsigned int)') [-Wincompatible-function-pointer-types]
        c->update   = av_sha_update;
                    ^ ~~~~~~~~~~~~~
libavutil/hmac.c:79:21: error: incompatible function pointer types assigning to 'void (*)(void *, uint8_t *)' (aka 'void (*)(void *, unsigned char *)') from 'void (struct AVSHA *, uint8_t *)' (aka 'void (struct AVSHA *, unsigned char *)') [-Wincompatible-function-pointer-types]
        c->final    = av_sha_final;
                    ^ ~~~~~~~~~~~~
libavutil/hmac.c:86:21: error: incompatible function pointer types assigning to 'void (*)(void *, const uint8_t *, int)' (aka 'void (*)(void *, const unsigned char *, int)') from 'void (struct AVSHA *, const uint8_t *, unsigned int)' (aka 'void (struct AVSHA *, const unsigned char *, unsigned int)') [-Wincompatible-function-pointer-types]
        c->update   = av_sha_update;
                    ^ ~~~~~~~~~~~~~
libavutil/hmac.c:87:21: error: incompatible function pointer types assigning to 'void (*)(void *, uint8_t *)' (aka 'void (*)(void *, unsigned char *)') from 'void (struct AVSHA *, uint8_t *)' (aka 'void (struct AVSHA *, unsigned char *)') [-Wincompatible-function-pointer-types]
        c->final    = av_sha_final;
                    ^ ~~~~~~~~~~~~
9 errors generated.
make: *** [libavutil/hmac.o] Error 1
@rfpm
Copy link

rfpm commented Mar 30, 2024

Exact same issue for me, find a fix?

@eaditjhw
Copy link

eaditjhw commented Apr 3, 2024

This seems to work for me:

brew install bzip2
git clone --recurse-submodules https://github.com/ponchio/untrunc
cd untrunc/libav
**./configure --extra-cflags=-Wno-error=incompatible-function-pointer-types**
make
cd ..
g++ -o untrunc -I./libav file.cpp main.cpp track.cpp atom.cpp codec_*.cpp codecstats.cpp codec.cpp mp4.cpp log.cpp -L./libav/libavformat -lavformat -L./libav/libavcodec -lavcodec -L./libav/libavresample -lavresample -L./libav/libavutil -lavutil -lpthread -lz -std=c++11 -framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration -lbz2

It's the additional cflags in the configure which seems to do the trick. At least I have a binary .. will see if it works :)

@tvsj
Copy link

tvsj commented Sep 15, 2024

This seems to work for me:

brew install bzip2
git clone --recurse-submodules https://github.com/ponchio/untrunc
cd untrunc/libav
**./configure --extra-cflags=-Wno-error=incompatible-function-pointer-types**
make
cd ..
g++ -o untrunc -I./libav file.cpp main.cpp track.cpp atom.cpp codec_*.cpp codecstats.cpp codec.cpp mp4.cpp log.cpp -L./libav/libavformat -lavformat -L./libav/libavcodec -lavcodec -L./libav/libavresample -lavresample -L./libav/libavutil -lavutil -lpthread -lz -std=c++11 -framework CoreFoundation -framework CoreVideo -framework VideoDecodeAcceleration -lbz2

It's the additional cflags in the configure which seems to do the trick. At least I have a binary .. will see if it works :)

work for me too!Thanks!

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

4 participants