【发布时间】:2016-06-11 00:28:20
【问题描述】:
我已经下载了source of x264 library。
x264的版本是148。
对于共享 dll 的编译,我使用以下命令 MSYS 环境:
./configure --disable-cli --enable-shared --prefix=.
结果如下:
platform: X86_64
byte order: little-endian
system: WINDOWS
cli: no
libx264: internal
shared: yes
static: no
asm: yes
interlaced: yes
avs: no
lavf: no
ffms: no
mp4: no
gpl: yes
thread: win32
opencl: yes
filters: crop select_every
debug: no
gprof: no
strip: no
PIC: yes
bit depth: 8
chroma format: all
执行make后出现以下错误:
common/win32thread.o:win32thread.c:(.text+0x60): undefined reference to `_beginthreadex'
common/win32thread.o:win32thread.c:(.text+0x60): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_beginthreadex'
collect2: error: ld returned 1 exit status
Makefile:192: recipe for target 'libx264-148.dll' failed
make: *** [libx264-148.dll] Error 1
我的工作环境:
- Windows 10 专业版
- MSYS64 和 mingw64
- Microsoft Visual Studio 2015
configure 命令执行没有错误,但是 make 给了我上面描述的错误。
【问题讨论】:
-
很奇怪。 process.h 是WinGW 的一部分。你可以试试
make -D__MSVCRT__。 -
尊敬的蒂姆先生,非常感谢您的回答。目标是在 GCC 环境中构建 DLL。选项 make -D__MSVCRT__ 与 MSVC 环境有关。命令 $ make -D__MSVCRT__ 给出错误 make: invalid option -- D make: invalid option -- _ make: invalid option -- _ make: invalid option -- M make: invalid option -- V 用法:make [options] [目标] ...