MSYS2-packages
MSYS2-packages copied to clipboard
ffmpeg freetype2 on msys2
Describe the issue
I build https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/#compiling-for-windows on msys2. I already install freetype2 but it still can't find the path of freetype2
Steps to Reproduce the Problem
Follow the installation and add --enable-libfreetype
.
I use --extra-cflags
and --extra-ldflags
to assign the path of libfreetype.
But meet the error ERROR: freetype2 not found using pkg-config
and it try to use pkg-config to find freetype2 .pc file
END ./ffconf.XlJKo3ZL/test.cu
nvcc -gencode arch=compute_52,code=sm_52 -O2 -m64 -ptx -c -o ffconf.XlJKo3ZL/test.o ffconf.XlJKo3ZL/test.cu
test.cu
require_pkg_config libfreetype freetype2 ft2build.h FT_FREETYPE_H FT_Init_FreeType
check_pkg_config libfreetype freetype2 ft2build.h FT_FREETYPE_H FT_Init_FreeType
test_pkg_config libfreetype freetype2 ft2build.h FT_FREETYPE_H FT_Init_FreeType
false --exists --print-errors freetype2
ERROR: freetype2 not found using pkg-config
I try the
pacman -S mingw-w64-x86_64-freetype
pkg-config freetype2 --libs
It is still the error.
- OS: [e.g. Windows 10 Pro version 1909 64bit]
you might need mingw-w64-x86_64-pkgconf
as well, seems like configure didn't detect pkg-config
Using mingw-w64-x86_64-pkgconf
, it is still the problem.
pacman -S mingw-w64-x86_64-pkg-config
Just to make sure, you did run these through the blue MINGW64 environment and not the purple/pink MSYS environment, right? Can you upload the ffbuild/config.log somewhere like gist.github.com and paste it here?
I use blue MINGW64 by From the Visual Studio x64 Native Tools Command Prompt, launch the MinGW64 environment by running mingw64.exe from the msys2 installation folder
Can you try running pkg-config --version
and check the output of echo $?
? According to FFmpeg's configure,
set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
target_exec x86asmexe metalcc metallib
enabled cross_compile || host_cc_default=$cc
set_default host_cc
pkg_config_fail_message=""
if ! $pkg_config --version >/dev/null 2>&1; then
warn "$pkg_config not found, library detection may fail."
pkg_config=false
elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
pkg_config_fail_message="
Note: When building a static binary, add --pkg-config-flags=\"--static\"."
fi
it sets $pkg_config
to false
(the false --exists --print-errors freetype2
occurs because of this) if --version
errors out
$ pacman-key --keyserver keyserver.ubuntu.com --refresh-keys
$ pkg-config --version
0.29.2
echo $?
0
- try pkgconf, not pkg-config, instead, it should be a better, drop-in replacement for pkg-config (subjective)
- Did you download the latest msys2? You might want to try from there, if you still need this install, you can try some commands mentioned in https://www.msys2.org/news/#2020-06-29-new-packagers, but I personally haven't had the issue, so I can't help further with that
a return of 127 usually occurs when bash itself fails to find a command, but that shouldn't occur if pkg-config --version prints something
I install the newer https://www.msys2.org/news/#2020-06-29-new-packagers.
How to assign pkgconf not pkg-config?
pacman -S mingw-w64-x86_64-pkgconf
will install pkgconf and remove pkg-config
I install it and build again, but the message say
ERROR: freetype2 not found using pkg-config
not pkgconf
Just to make sure, pkgconf --version
still errors with 127?
$ pkgconf --version
1.7.4
$ echo $?
0
Okay, try pkg-config --version
, it should say the same thing
yes, it is the same thing.
$ pkg-config --version
1.7.4
$ echo $?
0
When you run configure, does ffbuild/config.log still have a line with WARNING: pkg-config not found, library detection may fail.
?
no find similar message WARNING: pkg-config not found, library detection may fail
try it again.
Do you have the method that stop use pkg-config? and use pkg-config to generate the freetype2.pc
# pkg-config freetype2 --libs
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'freetype2', required by 'virtual:world', not found
# pkg-config freetype2 --cflags
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'freetype2', required by 'virtual:world', not found
What does echo $PKG_CONFIG_PATH
print?
I try to install freetype2 with msys2. But it is still fail.
pacman -S mingw-w64-x86_64-freetype
I meet another error
C:/msys64/mingw64/bin/../include\stdlib.h(706): error C2085: 'fcvt': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(707): error C2085: 'gcvt': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(708): error C2085: 'itoa': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(709): error C2085: 'ltoa': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(710): error C2085: 'putenv': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(714): error C2085: 'swab': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(717): error C2085: 'ultoa': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(718): error C2085: 'onexit': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(724): error C2085: 'lldiv_t': not in formal parameter list
C:/msys64/mingw64/bin/../include\stdlib.h(726): error C2061: syntax error: identifier 'lldiv_t'
C:/msys64/mingw64/bin/../include\malloc.h(80): fatal error C1083: Cannot open include file: 'mm_malloc.h': No such file or directory
ERROR: freetype2 not found using pkg-config
Do you have another method to install ffmpeg with --enable-libfreetype
?
pacman -S mingw-w64-x86_64-freetype
It will generate the freetype2.pc
prefix=/mingw64
libdir=${prefix}/lib
includedir=${prefix}/include
Name: FreeType 2
Description: A free, high-quality, and portable font engine.
URL: https://freetype.org
Version: 24.1.18
Requires.private: zlib, libpng, harfbuzz >= 2.0.0, libbrotlidec
Libs: -L${libdir} -lfreetype
Libs.private: -lbz2
Cflags: -I${includedir}/freetype2
But the libdir
no the library. Nothing at all.