Difference between revisions of "Win32CompileMSYSTroubleShooting"

From VideoLAN Wiki
Jump to navigation Jump to search
(added several new errors)
Line 124: Line 124:
  #  eval "$$MAKENSIS $(win32_destdir)/spad.nsi"; \
  #  eval "$$MAKENSIS $(win32_destdir)/spad.nsi"; \
  #  eval "$$MAKENSIS $(win32_destdir)/vlc.win32.nsi"
  #  eval "$$MAKENSIS $(win32_destdir)/vlc.win32.nsi"

Revision as of 13:53, 14 August 2013


This is a list of various errors that have occurred "over the years" during building VLC with windows, with their resolutions. Of course, if it's not here, google is your friend.

  • "unix2dos" command not found: this meant "you forgot to install mingw-utils"
  • It doesn't link, and complains about missing gcc symbols: You missed this line in the instructions:

Use text editor to change MinGW\lib\gcc\mingw32\4.4.0\libstdc++.la file (line should be library_names=) due to bug in latest MinGW.

Originally, there was apparently a bug with 4.4.0 GCC (not 4.4.1), fixed thus (except that in reality, you must use TDM, not vanilla GCC, because you need sljl exception handling):

Then, update Mingw GCC to 4.4.0 by downloading http://sourceforge.net/projects/mingw/files/GCC%20Version%204/gcc-full-4.4.0-mingw32-bin-2.tar.lzma/download and extracting it to C:\Mingw (replacing files when asked). Finally, you'll gave to fix the file C:\MinGW\lib\gcc\mingw32\4.4.0\libstdc++.la by opening it and changing the line defining library_names so that it reads library_names=''

  • Compilation stops early, after configure was complaining about mismatched quotes:

Check the VLC_COMPILE_HOST variable in your config.h - if it's Option f is not valid then hostname -f fails (on Windows, there is no such option as -f). In configure.ac change

AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname -f 2> /dev/null || hostname`", [host which ran configure])


AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname`", [host which ran configure])
  • If compile complains about a config.h and pthread.h not found problem, just delete config.h
  • If building self-contained packages fails with make: zip: Command not found then download the following file and extract it to C:\Msys\1.0 :


  • If building self-contained packages fails with make: 7z: Command not found then copy 7z.exe from C:\Program Files\7-Zip in to C:\Msys\1.0\bin
  • If building self-contained packages fails with Error: cannot locate makensis tool then use:
PATH=/c/Program\ Files/NSIS/:$PATH make package-win32
  • "/bin/m4: cannot remove temporary directory /tmp/..." during bootstrap. Disable any real-time scanning programs you have enabled (your anti-virus, Windows Defender) and convert configure.ac to Unix new lines.

contribs make prebuilt fails with tar errors

You may get several tar errors before the "make prebuilt" fails with an error like this:

tar: i586-mingw32msvc/lib/libdts.a: Cannot create symlink to `/home/jb/vlc-2.0/contrib/i586-mingw32msvc/lib/libdca.a': No such file or directory
tar: Error exit delayed from previous errors
make: *** [prebuilt] Error 2

Ignore it and run the rest of the prebuilt target as the wiki details:

mv i586-mingw32msvc ..
cd ../i586-mingw32msvc

change_prefix.sh fails

You may see an error like this

   mv: cannot move `./change_prefix.sh.tmp' to `./change_prefix.sh': Permission denied

This appears to be harmless. The script continues to execute afterwards. Note that there will be no status updates for a few minutes, so it may appear frozen. Don't Ctrl-C or cancel the process.

configure fails b/c of unreferenced contribs

On some setups, configure may fail with the following error:

configure: error: Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.

If you try --disable-lua, and you may still run into errors with live555, mad and eventually libfaad.

The issue can be resolved by explicitly referencing your contrbs. Note that your contribs will be in this folder C:\msys\1.0\home\<username>\vlc\contrib\i586-mingw32msvc. In order for configure to pick up the location, add a --with-contrib=contrib/i586-mingw32msvc

sh extras/package/win32/configure.sh --host=i586-pc-mingw32msvc --with-contrib=contrib/i586-mingw32msvc --disable-nls

make fails b/c of libpng

make may fail because of missing libpng files

/bin/sed: can't read /home/<username>/vlc/contrib/i586-mingw32msvc/lib/libpng.la: No such file or directory
libtool: link: `/home/<username>/vlc/contrib/i586-mingw32msvc/lib/libpng.la' is not a valid libtool archive

If so, find the libpng15.la and libpng15.a files in that directory and copy them to libpng.la and libpng.a. (You should end up with the same path referenced in the above error)

make fails b/c of missing moc, rcc, uic

make may also fail because of missing commands for moc, rcc, uic:

/bin/sh: moc: command not found
make[5]: *** [main_interface.moc.cpp] Error 127
/bin/sh: rcc: command not found
make[5]: *** [resources.cpp] Error 127
/bin/sh: uic: command not found
make[5]: *** [ui/equalizer.h] Error 127

You can workaround this by by copying the corresponding command.exe from the contrib directory to my bin directory

source: C:\msys\1.0\home\<username>\vlc\contrib\i586-mingw32msvc\moc.exe
target: C:\msys\1.0\bin\moc.exe

make fails b/c of compile error 'expected unqualified-id'

make may also fail with a compile error in gui/qt with "expected unqualified-id before 'char'"

In file included from dialogs_provider.cpp:42:0:
dialogs/preferences.hpp: At global scope:
dialogs/preferences.hpp:72:19: error: expected unqualified-id before 'char'
dialogs/preferences.hpp:72:18: error: expected ';' at end of member declaration
dialogs/preferences.hpp:72:24: error: expected unqualified-id before ',' token

If so, do the following

  • open up C:\msys\1.0\home\<username>\vlc\include\vlc_windows_interfaces.h
  • add "#undef small" on a new line directly underneath "#include <objbase.h>"

See this forum thread for more info

make fails b/c of unknown rule

make package-win32-base may fail with the following:

make: *** No rule to make target `package-win32-base'.  Stop.

If so, use package-win32-exe, package-win-base or common

make fails b/c of missing git, svn, makensis

  • For git, copy the git.exe from your Git installation to C:\msys\1.0\bin\.
  • For svn, you can get the entire bin folder from collab.net.
  • For makensis you can comment out the lines in Makefile
# Create package
#   if makensis -VERSION >/dev/null 2>&1; then \
#       MAKENSIS="makensis"; \
#   elif [ -x "/cygdrive/c/Program Files/NSIS/makensis" ]; then \
#       MAKENSIS="/cygdrive/c/Program\ Files/NSIS/makensis"; \
#   elif [ -x "$(PROGRAMFILES)/NSIS/makensis" ]; then \
#       MAKENSIS="$(PROGRAMFILES)/NSIS/makensis"; \
#   elif wine --version >/dev/null 2>&1; then \
#       MAKENSIS="wine C:/Program\ Files/NSIS/makensis.exe"; \
#   else \
#       echo 'Error: cannot locate makensis tool'; exit 1; \
#   fi; \
#   eval "$$MAKENSIS $(win32_destdir)/spad.nsi"; \
#   eval "$$MAKENSIS $(win32_destdir)/vlc.win32.nsi"