Cannot import libwinpthread

Issue #242 resolved
Former user created an issue

Hello. I am aware that this doesn't have to be x265 problem, but after cross-compiling from Linux to Windows, which went well, I get error that libwinpthread-1.dll is missing. I have no idea why this happens. I was doing just what wiki said. I used many .cmake file configuration, but compiler seems to omit the libwinpthread completely (while it is on drive)

This is my .cmake file:

SET(CMAKE_SYSTEM_NAME Windows)

SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
SET(CMAKE_ASM_YASM_COMPILER yasm)

SET(CMAKE_CXX_FLAGS "-static-libgcc -static-libstdc++ -static -O3 -pthread -s")
SET(CMAKE_C_FLAGS "-static-libgcc -static-libstdc++ -static -pthread -O3 -s")
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-static-libgcc -static-libstdc++ -static -pthread -O3 -s")
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-static-libgcc -static-libstdc++ -static -pthread -O3 -s")

I don't want to include libwinpthread-1.dll in the file's folder, because I find that unnecessary when it can be built-in. Anyway, I cannot get cmake to compile it with it. Any ideas? Is it compiler error, cmake error or is it source? I have absolutely no idea what could fix this because I don't see anyone else complaining about this.

Comments (3)

  1. Val Olszar

    (Registered so I can add more info) If I take libwinpthread-1.dll from mingw libs to Windows drive and execute x265.exe, it works perfectly fine. But why doesn't compiler import it to the .exe?

    Edit: Oh, I didn't realize pre-built packages (from apt) are older version. GCC 5.3.0 compiles with pthread automatically.

  2. Log in to comment