shinchiro / mpv-winbuild-cmake

CMake-based MinGW-w64 Cross Toolchain
616 stars 114 forks source link

Not compiling using Ubuntu #20

Closed chowey closed 5 years ago

chowey commented 5 years ago

I've followed the directions and almost have success. I am using Ubuntu to compile the 64-bit version.

It successfully compiled all the way to "mpv" itself. However, I am now getting a bunch of linker errors.

../osdep/win32-console-wrapper.c:22:6: warning: no previous prototype for 'cr_perror' [-Wmissing-prototypes]
 void cr_perror(const wchar_t *prefix)
      ^~~~~~~~~
../osdep/win32-console-wrapper.c:37:5: warning: no previous prototype for 'cr_runproc' [-Wmissing-prototypes]
 int cr_runproc(wchar_t *name, wchar_t *cmdline)
     ^~~~~~~~~~
../osdep/win32-console-wrapper.c:73:5: warning: no previous prototype for 'wmain' [-Wmissing-prototypes]
 int wmain(int argc, wchar_t **argv, wchar_t **envp)
     ^~~~~

/home/chowey/mpv-winbuild-cmake/build64/install/lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld: /home/chowey/mpv-winbuild-cmake/build64/install/mingw/lib/libOpenAL32.a(alc.cpp.obj):/home/chowey/mpv-winbuild-cmake/build64/install/x86_64-w64-mingw32/include/c++/8.2.1/mutex:679: undefined reference to `std::__get_once_mutex()'
/home/chowey/mpv-winbuild-cmake/build64/install/lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld: /home/chowey/mpv-winbuild-cmake/build64/install/mingw/lib/libOpenAL32.a(alc.cpp.obj):/home/chowey/mpv-winbuild-cmake/build64/install/x86_64-w64-mingw32/include/c++/8.2.1/mutex:681: undefined reference to `std::__set_once_functor_lock_ptr(std::unique_lock<std::mutex>*)'
/home/chowey/mpv-winbuild-cmake/build64/install/lib/gcc/x86_64-w64-mingw32/8.2.1/../../../../x86_64-w64-mingw32/bin/ld: /home/chowey/mpv-winbuild-cmake/build64/install/mingw/lib/libOpenAL32.a(alc.cpp.obj): in function `__gthread_once':
/home/chowey/mpv-winbuild-cmake/build64/install/x86_64-w64-mingw32/include/c++/8.2.1/x86_64-w64-mingw32/bits/gthr-default.h:699: undefined reference to `__once_proxy'
...

(The full error log can be found here).

It seems like the linker is missing some mutex objects for the libOpenAL32 library. Any clues?

shinchiro commented 5 years ago

I try today and it managed to compile mpv successfully on Ubuntu 18.04.1. Might be temporary broken commit. Try again by ninja openal-soft-removebuild and proceed to ninja mpv

btw, did you manage to compile libressl successfully?

chowey commented 5 years ago

I did manage to compile libressl successfully by manually reverting crypto/cryptlib.c to the previous commit, which doesn't include <syslog.h>.

I tried again and I am still getting the same error. I am using Ubuntu 18.10 - maybe one of my build tools is too new?

chowey commented 5 years ago

After using Ubuntu 18.04.1 (and upgrading cmake, meson, etc. as needed), it DID compile successfully.

I am not sure the difference with the 18.10 build environment, but there definitely seems to be one.

shinchiro commented 5 years ago

Did not has chance to test with Ubuntu 18.10 yet. But in theory it should works on all linux distros