Page 1 of 1

need help on compile error caused by one of the contribs

Posted: 27 Sep 2013 21:49
by eddiek
Hello,
I'm trying to compile vlc in a mingw/msys environment but keep getting the error below. I followed all the steps in the https://wiki.videolan.org/Win32CompileMSYSNew/ wiki and also looked at the trouble shooting guide but could not get a solution. Any help on how to proceed would be appreciated. Thanks.


C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x5ea): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x60b): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x189b): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x18bb): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x28cc): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x28f0): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x293d): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x295d): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x2c9e): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x2cbe): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x2cf8): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x2d18): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x3fd2): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x3ff2): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x5622): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x5642): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x56d2): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x56f2): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x5758): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x5778): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x57ef): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x5813): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x6882): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x68ac): undefined reference to `WSASetLastError@4'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x7053): undefined reference to `WSAGetLastError@0'
C:/msys/1.0/home/ekibicho/vlc_source/vlc/contrib/i586-mingw32msvc/lib/libpthreadGC2.a(pthread.o):pthread.c:(.text+0x7076): undefined reference to `WSASetLastError@4'
collect2.exe: error: ld returned 1 exit status
make[4]: *** [libzvbi_plugin.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Re: need help on compile error caused by one of the contribs

Posted: 29 Sep 2013 08:05
by gnosygnu
Hi. I got this same error as well. I skipped the zvbi module and got much further, but not after several workarounds.

I detail more below. For any of the developers, my summarized list of questions is as follows:
  • is the m4 workaround below correct?
  • is libpthreadGC2.a broken, or if there is another way to build libzvbi?
  • is the libFLAC workaround correct?
  • what is the correct fix for direct2d.c and IID_ID2D1Factory?
  • what is the correct fix for events.c and tolower?
  • what is the fix for ole2.h?
  • why did the process stop after making the vlc-2.2.0-git directory?

Background
First, for reference's sake, I used the walkthrough here: https://wiki.videolan.org/Win32CompileMSYS/ (which includes the prebuilt msys). I only deviated from the walkthrough in each of the sections listed below.

Also, I'm trying this on a new Windows 7 64-bit system. I chose the 32 bit version for TDM/MinGW (since 64 bit was marked experimental).

config tools and m4 error
I got the error "configure: error: no acceptable m4 could be found in $PATH." I found this thread here: https://forum.videolan.org/viewtopic.php?f=14&t=106503.

I resolved it by opening \vlc\extras\tools\packages.mak and changing AUTOCONF_VERSION=2.69 -> AUTOCONF_VERSION=2.67

zvbi and WSAGetLastError
I then got the WSAGetLastError during the zvbi process

I tried various things with zvbi to work around the WSAGetLastError. However, my limited understanding is that there is something wrong with the pre-built contrib: libpthreadGC2.a. Here is my reasoning:
  • WSAGetLastError appears to be related to libws2_32.a
  • libws2_32.a is on my machine at C:\MinGW\lib\libws2_32.a
  • Meanwhile, the undefined reference error is coming from libpthreadGC2.a
  • As libpthreadGC2.a is a contrib binary, it is not configurable by the VLC build process
  • For good measure, I tried adding "-lws2_32" to libzvbi.la. Still the same error
I ended up disabling this module by adding "-disable-zvbi" to configure.

libFLAC: undefined reference to `ntohl@4'
After disabling libzvbli, I got this error:

Code: Select all

Creating library file: .libs/libflac_plugin.dll.aC:/MinGW/msys/home/gnosygnu/vlc/contrib/i586-mingw32msvc/lib/libFLAC.a(bitwriter.o): In function `FLAC__bitwriter_get_buffer': /home/jb/vlc-2.0/contrib/win32/flac/src/libFLAC/bitwriter.c:286: undefined reference to `ntohl@4' /home/jb/vlc-2.0/contrib/win32/flac/src/libFLAC/bitwriter.c:286: undefined reference to `ntohl@4' /home/jb/vlc-2.0/contrib/win32/flac/src/libFLAC/bitwriter.c:286: undefined reference to `ntohl@4' C:/MinGW/msys/home/gnosygnu/vlc/contrib/i586-mingw32msvc/lib/libFLAC.a(bitwriter.o): In function `FLAC__bitwriter_write_rice_signed_block': /home/jb/vlc-2.0/contrib/win32/flac/src/libFLAC/bitwriter.c:611: undefined reference to `ntohl@4' /home/jb/vlc-2.0/contrib/win32/flac/src/libFLAC/bitwriter.c:645: undefined reference to `ntohl@4' C:/MinGW/msys/home/gnosygnu/vlc/contrib/i586-mingw32msvc/lib/libFLAC.a(bitwriter.o):/home/jb/vlc-2.0/contrib/win32/flac/src/libFLAC/bitwriter.c:321: more undefined references to `ntohl@4' follow
`ntohl@4' is also related to the ws2_32 library. I fixed this by opening C:\MinGW\msys\home\gnosygnu\vlc\contrib\mingw32\lib\libFLAC.la and adding "-lws2_32"

Code: Select all

dependency_libs=' -L/home/gnosygnu/vlc/contrib/i586-mingw32msvc/lib -lws2_32 -lm /home/gnosygnu/vlc/contrib/i586-mingw32msvc/lib/libogg.la'
msw/events.c: implicit declaration of function 'tolower'

Code: Select all

../../../extras/package/win32/../../../modules/video_output/msw/events.c: In function 'EventThread': ../../../extras/package/win32/../../../modules/video_output/msw/events.c:276:17: error: implicit declaration of function 'tolower' [-Werror=implicit-function-declaration]
I opened the file and commented out the line (which I understand will probably break direct2d, but I wanted to finish compiling)

mws/direct2d.c: IID_ID2D1Factory' undeclared

Code: Select all

../../../extras/package/win32/../../../modules/video_output/msw/direct2d.c: In function 'Open': ../../../extras/package/win32/../../../modules/video_output/msw/direct2d.c:121:45: error: 'IID_ID2D1Factory' undeclared (first use in this function) ../../../extras/package/win32/../../../modules/video_output/msw/direct2d.c:121:45: note: each undeclared identifier is reported only once for each function it appears in
I opened the file and declared the variable as a NULL (again, I just wanted to finish compiling)

error: required OLE header ole2.h is missing from your system
Compiling finally completed. However, the package making failed with the ole2.h error.

I found this thread (https://forum.videolan.org/viewtopic.php?f=14&t=111646) and checked my config.log file in napi-vlc. The relevant excerpt is below

Code: Select all

configure:17031: checking ole2.h usability configure:17031: g++ -static-libgcc -static-libstdc++ -c -g -O2 -I/home/gnosygnu/vlc/contrib/mingw32/include -mms-bitfields -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -ffast-math -funroll-loops -fomit-frame-pointer -I../extras/package/win32/../../../include -I./include -I/home/gnosygnu/vlc/contrib/mingw32/include -D__USE_MINGW_ANSI_STDIO=1 conftest.cpp >&5 g++.exe: error: unrecognized command line option '-static-libstdc++' configure:17031: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "npapi-vlc" | #define PACKAGE_TARNAME "npapi-vlc" | #define PACKAGE_VERSION "2.1.0" | #define PACKAGE_STRING "npapi-vlc 2.1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "npapi-vlc" | #define VERSION "2.1.0" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define __EXTENSIONS__ 1 | #define _ALL_SOURCE 1 | #define _GNU_SOURCE 1 | #define _POSIX_PTHREAD_SEMANTICS 1 | #define _TANDEM_SOURCE 1 | #define _FORTIFY_SOURCE 2 | #define LT_OBJDIR ".libs/" | #define _WIN32_WINNT 0x0501 | #define _WIN32_IE 0x0600 | #define _WIN32 1 | /* end confdefs.h. */ | #include <stdio.h> | #ifdef HAVE_SYS_TYPES_H | # include <sys/types.h> | #endif | #ifdef HAVE_SYS_STAT_H | # include <sys/stat.h> | #endif | #ifdef STDC_HEADERS | # include <stdlib.h> | # include <stddef.h> | #else | # ifdef HAVE_STDLIB_H | # include <stdlib.h> | # endif | #endif | #ifdef HAVE_STRING_H | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H | # include <memory.h> | # endif | # include <string.h> | #endif | #ifdef HAVE_STRINGS_H | # include <strings.h> | #endif | #ifdef HAVE_INTTYPES_H | # include <inttypes.h> | #endif | #ifdef HAVE_STDINT_H | # include <stdint.h> | #endif | #ifdef HAVE_UNISTD_H | # include <unistd.h> | #endif | #include <ole2.h> configure:17031: result: no configure:17031: checking ole2.h presence configure:17031: g++ -E -I../extras/package/win32/../../../include -I./include -I/home/gnosygnu/vlc/contrib/mingw32/include -D__USE_MINGW_ANSI_STDIO=1 conftest.cpp configure:17031: $? = 0 configure:17031: result: yes configure:17031: WARNING: ole2.h: present but cannot be compiled configure:17031: WARNING: ole2.h: check for missing prerequisite headers? configure:17031: WARNING: ole2.h: see the Autoconf documentation configure:17031: WARNING: ole2.h: section "Present But Cannot Be Compiled" configure:17031: WARNING: ole2.h: proceeding with the compiler's result configure:17031: checking for ole2.h configure:17031: result: no configure:17035: error: required OLE header ole2.h is missing from your system
I looked up the error: unrecognized command line option '-static-libstdc++' and found this thread: http://stackoverflow.com/questions/1422 ... ingw-4-7-1

This seems to indicate that I should be using TDM/MinGW 4.7.1, not 4.6.3. However the walkthrough explicitly crosses out 4.7.1 and directs to 4.6.3. Should 4.7.1 not be used?

On a wild guess, I then searched for '-static-libstdc++' in all files, and replaced it with "-static -lstdc++ -dynamic".

Surprisingly, this worked. The process continued and even generated the vlc-2.2.0-git directory, until...

cannot stat `axvlc.dll'

Code: Select all

cp -r /home/gnosygnu/vlc/win32/_win32/share/locale /home/gnosygnu/vlc/win32/vlc-2.2.0-git cp: cannot stat `/home/gnosygnu/vlc/win32/_win32/share/locale': No such file or directory make: [package-win-common] Error 1 (ignored) mkdir -p /home/gnosygnu/vlc/win32/vlc-2.2.0-git/lua/ cp -r /home/gnosygnu/vlc/win32/_win32/lib/vlc/lua/* /home/gnosygnu/vlc/win32/_win32/share/vlc/lua/* /home/gnosygnu/vlc/win32/vlc-2.2.0-git/lua/ rm -fr /home/gnosygnu/vlc/win32/vlc-2.2.0-git/skins cp -r /home/gnosygnu/vlc/win32/_win32/share/vlc/skins2 /home/gnosygnu/vlc/win32/vlc-2.2.0-git/skins cp "./npapi-vlc/activex/axvlc.dll.manifest" "/home/gnosygnu/vlc/win32/vlc-2.2.0-git/" cp "./npapi-vlc/installed/lib/axvlc.dll" "/home/gnosygnu/vlc/win32/vlc-2.2.0-git/" cp: cannot stat `./npapi-vlc/installed/lib/axvlc.dll': No such file or directory make: *** [package-win-common] Error 1
At which point, I gave up. It was late. There were no error messages on screen for the activex build, but the file was clearly not there.