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

Static linking #172

Open
thewh1teagle opened this issue Jan 9, 2024 · 1 comment
Open

Static linking #172

thewh1teagle opened this issue Jan 9, 2024 · 1 comment

Comments

@thewh1teagle
Copy link

thewh1teagle commented Jan 9, 2024

I use ffmpeg_next in ruscribe
And I build it inside msys2 environment (ucrt64)
It works well, but if I want to use it outside of the environment (in windows itself)
there's missing DLL's which it needs to load dynamically,
I would like to link them staticlly so I can ship single exe to users without extra files.

The error looks like
image

Missing DLL(s) are:
avdevice-60.dll
avfilter-9.dll
avformat-60.dll
avcodec-60.dll
The are in C:\msys64\ucrt64\bin\
Coming from the package:
mingw-w64-ucrt-x86_64-ffmpeg

@thewh1teagle
Copy link
Author

thewh1teagle commented Jan 9, 2024

Tried the following in msys2 inside ucrt64 terminal

NAME=ffmpeg-n4.4-latest-win64-gpl-shared-4.4
if [ ! -d shared/$NAME ]; then
    wget -q --show-progress https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/$NAME.zip -O shared.zip
    unzip shared.zip -d shared
fi

export FFMPEG_DIR="$(pwd)/shared/$NAME"
echo "\$FFMPEG_DIR is $FFMPEG_DIR"

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$FFMPEG_DIR/lib/pkgconfig
echo "\$PKG_CONFIG_PATH is $PKG_CONFIG_PATH"
export PKG_CONFIG_SYSTEM_INCLUDE_PATH="$FFMPEG_DIR/libavcodec:$FFMPEG_DIR/libavdevice:$FFMPEG_DIR/libavfilter:$FFMPEG_DIR/libavformat:$FFMPEG_DIR/libavutil:$FFMPEG_DIR/libpostproc:$FFMPEG_DIR/libswresample:$FFMPEG_DIR/libswscale"
echo "\$PKG_CONFIG_SYSTEM_INCLUDE_PATH is $PKG_CONFIG_SYSTEM_INCLUDE_PATH"
export LIBCLANG_PATH=$MINGW_PREFIX/bin
cargo build

It almost finish compile and then

error: could not find native static library `avcodec`, perhaps an -L flag is missing?

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

1 participant