Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] configure doesn't seem to use pkg-config flags?
@ 2024-01-18  3:38 Roger Pack
  2024-01-18 13:31 ` Timo Rothenpieler
  0 siblings, 1 reply; 6+ messages in thread
From: Roger Pack @ 2024-01-18  3:38 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Hello.
After compiling libx265 as a "static library" (mingw cross compiling
targeting win64)

$ pkg-config --libs --static x265
-L/home/rdp/new/sandbox/win64_static/build_files/lib -lx265
/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -lgcc

I get this failure at configure time:

./configure --enable-libx265 --arch=x86_64 --target-os=mingw32
--cross-prefix=x86_64-w64-mingw32- --pkg-config=pkg-config
--pkg-config-flags=--static

ERROR: x265 not found using pkg-config

config.log (sorry it's verbose, first compile passes, second one fails linking)

...
require_pkg_config libx265 x265 x265.h x265_api_get
check_pkg_config libx265 x265 x265.h x265_api_get
test_pkg_config libx265 x265 x265.h x265_api_get
pkg-config --exists --print-errors x265
check_func_headers x265.h x265_api_get
-I/home/rdp/new/sandbox/win64_static/build_files/include
-L/home/rdp/new/sandbox/win64_static/build_files/lib -lx265
/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -lgcc
test_ld cc -I/home/rdp/new/sandbox/win64_static/build_files/include
-L/home/rdp/new/sandbox/win64_static/build_files/lib -lx265
/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -lgcc
test_cc -I/home/rdp/new/sandbox/win64_static/build_files/include
-L/home/rdp/new/sandbox/win64_static/build_files/lib
/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a
BEGIN /tmp/ffconf.L9GhKESq/test.c
    1   #include <x265.h>
    2   #include <stdint.h>
    3   long check_x265_api_get(void) { return (long) x265_api_get; }
    4   int main(void) { int ret = 0;
    5    ret |= ((intptr_t)check_x265_api_get) & 0xFFFF;
    6   return ret; }
END /tmp/ffconf.L9GhKESq/test.c
x86_64-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
-D__printf__=__gnu_printf__ -D_WIN32_WINNT=0x0600
-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -std=c11
-fomit-frame-pointer
-I/home/rdp/new/sandbox/win64_static/build_files/include
-L/home/rdp/new/sandbox/win64_static/build_files/lib
/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -c -o
/tmp/ffconf.L9GhKESq/test.o /tmp/ffconf.L9GhKESq/test.c
/tmp/ffconf.L9GhKESq/test.c: In function 'check_x265_api_get':
/tmp/ffconf.L9GhKESq/test.c:3:40: warning: cast from pointer to
integer of different size [-Wpointer-to-int-cast]
    3 | long check_x265_api_get(void) { return (long) x265_api_get; }
      |                                        ^
x86_64-w64-mingw32-gcc: warning:
/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a: linker input
file unused because linking not done
x86_64-w64-mingw32-gcc -Wl,--nxcompat,--dynamicbase
-Wl,--high-entropy-va -Wl,--as-needed -Wl,--image-base,0x140000000
-I/home/rdp/new/sandbox/win64_static/build_files/include
-L/home/rdp/new/sandbox/win64_static/build_files/lib
/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++.a -o
/tmp/ffconf.L9GhKESq/test.exe /tmp/ffconf.L9GhKESq/test.o -lx265 -lgcc
/usr/bin/x86_64-w64-mingw32-ld:
/home/rdp/new/sandbox/win64_static/build_files/lib/libx265.a(api.cpp.obj):api.cpp:(.text+0xfb5):
undefined reference to `operator new(unsigned long long)'
/usr/bin/x86_64-w64-mingw32-ld:
/home/rdp/new/sandbox/win64_static/build_files/lib/libx265.a(api.cpp.obj):api.cpp:(.text+0x1303):
undefined reference to `operator delete(void*)'
...

So it seems to be linking it not using the output of pkg-config --libs
--static for linking or something?

Workaround is  --extra-libs=-lstdc++ but something seems confusing to me here.
Advice welcome.  Or if I should file something let me know, thank you :)

-=roger
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-31 13:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18  3:38 [FFmpeg-devel] configure doesn't seem to use pkg-config flags? Roger Pack
2024-01-18 13:31 ` Timo Rothenpieler
2024-01-31  4:31   ` Roger Pack
2024-01-31 12:03     ` Timo Rothenpieler
2024-01-31 13:07       ` epirat07
2024-01-31 13:47         ` Timo Rothenpieler

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git