Compiling vlc using MinGw/Msys

This forum is about all development around libVLC.
sma
New Cone
New Cone
Posts: 8
Joined: 03 May 2012 00:36

Compiling vlc using MinGw/Msys

Postby sma » 03 May 2012 00:54

Hello,

I simply logged all my steps when I tried to compile and run the source code using MinGw/Msys, mainly because I wanted a backup in case I have to redo it. I'm quite sure that I have not found the best solution for all problems. Also I changed the order a bit to put all additional insallations at top. Hope it is the right place here and that someone will find it useful.

Greetings


1. Download intaller for MinGW/Msys
url: sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
take newest one


2. Install MinGW/Msys
run mingw-get-inst-*.exe

predefined,selected all

install-dir = <drive>:\<MinGW>

3. install add. packages
start:
<drive>:\<MinGW>\msys\1.0\msys.bat

! use "/"-notation here
/<drive>/<MinGW>/bin/mingw-get install msys-wget
/<drive>/<MinGW>/bin/mingw-get install mingw32-gettext
/<drive>/<MinGW>/bin/mingw-get install mingw32-lua
/<drive>/<MinGW>/bin/mingw-get install msys-libiconv
/<drive>/<MinGW>/bin/mingw-get install mingw32-libiconv
/<drive>/<MinGW>/bin/mingw-get install mingw32-libcharset
/<drive>/<MinGW>/bin/mingw-get install mingw32-binutils
/<drive>/<MinGW>/bin/mingw-get install mingw32-mingw-utils
/<drive>/<MinGW>/bin/mingw-get install g++

4. pkg-config
url: sourceforge.net/projects/pkgconfiglite/

extract into
<drive>:\<MinGW>\msys\1.0\


4b. Nasm

url: sourceforge.net/projects/nasm/files/Win32%20binaries/
e.g: nasm-2.07-win32.zip

Extract
nasm.exe
ndisasm.exe
into
<drive>:\<MinGW>\msys\1.0\bin

4c. yasm
url: http://www.tortall.net/projects/yasm/releases/
yasm-1.2.0-win32.exe

Rename into
yasm.exe
and put into
<drive>:\<MinGW>\msys\1.0\bin


4d. CMake

url: http://www.cmake.org/cmake/resources/software.html
cmake-2.8.8-win32-x86.zip

Extract into similar folder structure
<drive>:\<MinGW>\msys\1.0\

4e. git
(used in <vlc>/src)

url: msysgit.googlecode.com/files/PortableGit-1.7.10-preview20120409.7z

Extract _only_
git.exe
into
<drive>:\<MinGW>\msys\1.0\bin


5. vlc-Source
import using eclipse and egit
create project folder <vlc>

6. <vlc>/bootstrap
<vlc> = directory of vlc-project

cd <vlc>
./bootstrap


7. Workaround: configure.ac

change in file
<vlc>\configure.ac

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


8.
cd <vlc>
./configure
--> notice the build-value here = <build>



cd <vlc>/contrib/
mkdir my_gw
cd my_gw
../bootstrap --build=<build>



9. Workaround in Makefile

workaround:
cd <vlc>/contrib/my_gw

(first) change in Makefile:

old:
checksum = \
$(foreach f,$(filter $(TARBALLS)/%,$^), \
grep -- " $(f:$(TARBALLS)/%=%)$$" \
"$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS" &&) \
(cd $(TARBALLS) && $(1) /dev/stdin) < \
"$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS"

new:
checksum = \
$(foreach f,$(filter $(TARBALLS)/%,$^), \
grep -- " $(f:$(TARBALLS)/%=%)$$" \
"$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS" &&) \
(cd $(TARBALLS) && $(1) "$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS")

10. Start compile

cd <vlc>/contrib/my_gw
make

11. Workaround problem in package a25dec

Problem:
aclocal: macro `_LT_DECL_SED' required but not defined
aclocal: macro `_LT_FUNC_STRIPNAME_CNF' required but not defined

workaround:
cd <vlc>/contrib/my_gw/a25dec
rm aclocal.m4
rm Makefile.in
automake

start again:
cd <vlc>/contrib/my_gw/
make


12. Workaround problem "PKG_PROG_PKG_CONFIG: command not found" (e.g. package fontconfig)

Workaround:
cp /<drive>/<MinGW>/msys/1.0/share/aclocal/pkg.m4 <vlc>/contrib/<build>/share/aclocal

start again:
cd <vlc>/contrib/my_gw/
make


13. Workaround problem in fribidi

Problem:
libtool: link: more than one -exported-symbols argument is not allowed


cd <vlc>/contrib/my_gw/fribidi/lib

delete from the last command the argument
-export-symbols-regex "^fribidi_.*"
and run it

start again:
cd <vlc>/contrib/my_gw/
make

14. Workaround problem in caca


<vlc>/contrib/my_gw/fribidi/lib

Problem:
ln: creating symbolic link <vlc>/contrib/<build>/lib/libcucul.la : No such file or directory

workaround:
replace "ln -fs" with "$(LN_S)" in
<vlc>/contrib/caca/caca/Makrefile.am


old:

install-exec-local:
$(mkinstalldirs) $(DESTDIR)$(libdir)
. ./libcaca.la || exit 1; \
for x in $$library_names; do \
ln -sf $$x $(DESTDIR)$(libdir)/$$(echo $$x | sed 's/caca/cucul/g'); \
done
ln -sf libcaca.la $(DESTDIR)$(libdir)/libcucul.la

install-data-local:
$(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
ln -sf caca.pc $(DESTDIR)$(pkgconfigdir)/cucul.pc
$(mkinstalldirs) $(DESTDIR)$(includedir)
ln -sf caca.h $(DESTDIR)$(includedir)/cucul.h


new:

install-exec-local:
$(mkinstalldirs) $(DESTDIR)$(libdir)
. ./libcaca.la || exit 1; \
for x in $$library_names; do \
$(LN_S) $$x $(DESTDIR)$(libdir)/$$(echo $$x | sed 's/caca/cucul/g'); \
done
$(LN_S) libcaca.la $(DESTDIR)$(libdir)/libcucul.la

install-data-local:
$(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
$(LN_S) caca.pc $(DESTDIR)$(pkgconfigdir)/cucul.pc
$(mkinstalldirs) $(DESTDIR)$(includedir)
$(LN_S) caca.h $(DESTDIR)$(includedir)/cucul.h

start again:
cd <vlc>/contrib/my_gw/
make

15. Workaround problem in libebml-1.2.2

Problem:
(cd libebml-1.2.2 && patch -p1) < ../../contrib/src/ebml/ebml-pic.patch
patching file make/linux/Makefile
Hunk #1 FAILED at 59.
Hunk #2 FAILED at 81.
2 out of 2 hunks FAILED -- saving rejects to file make/linux/Makefile.rej
make: *** [libebml] Error 1


workaround:
dos2unix <vlc>/contrib/my_gw/libebml-1.2.2/make/linux/Makefile
dos2unix <vlc>/contrib/src/ebml/ebml-pic.patch
dos2unix <vlc>/contrib/src/ebml/no-ansi.patch

start again:
rm -r libebml-1.2.2
cd <vlc>/contrib/my_gw/
make


16. Workaround problem in zlib

Problem:
Please use win32/Makefile.gcc instead.
make: *** [.zlib] Error 1

workaround:

Edit <vlc>/contrib/src/my_gw/zlib/win32/Makefile.gcc cp <vlc>/contrib/src/my_gw/zlib/configure

old:
echo "Please use win32/Makefile.gcc instead."
exit 1

new:
#echo "Please use win32/Makefile.gcc instead."
#exit 1
cp win32/Makefile.gcc Makefile

start again:
cd <vlc>/contrib/my_gw/
make

17. Workaround problem in openjpeg

Problem:
Hunk #1 FAILED at 83.
1 out of 1 hunk FAILED -- saving rejects to file libopenjpeg/opj_malloc.h.rej

workaround:
dos2unix <vlc>/contrib/src/openjpeg/freebsd.patch

start again:
rm -r openjpeg-1.5.0
cd <vlc>/contrib/my_gw/
make


18. Workaround problem in libgpg-error

Problem:
much cpu and doesnt come back after line:
potomo: './po/pl.po' converting from ISO-8859-2 to utf-8

Workaround:
(looks like a bug in iconv ...)

Edit file <vlc>/contrib/my_gw/libgpg-error/potomo and replace "--silent" with "-s"

old:
echo "potomo: '$infile' converting from $fromset to utf-8" >&2
iconv --silent --from-code=$fromset --to-code=utf-8 < "$infile" |\
sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/"|\
msgfmt --output-file="$outfile" -

new:
echo "potomo: '$infile' converting from $fromset to utf-8" >&2
iconv -s --from-code=$fromset --to-code=utf-8 < "$infile" |\
sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/"|\
msgfmt --output-file="$outfile" -

start again:
cd <vlc>/contrib/my_gw/
make

19. Workaround problem in glew

Problem
ln: ... : can make relative symbolic links only in current directory


Workaround:

Edit file <vlc>/contrib/my_gw/glew/Makrefile and replace "ln -sf" with "cp -p"

old:
LN = ln -sf

new:
LN = cp -p


and something looks wrong with the path to "$(LIB.SHARED)", so add "lib/" here

old:
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME)

new:
$(LN) lib/$(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME)

start again:
cd <vlc>/contrib/my_gw/
make


20. Workaround problem in game-music-emu

Problem:
make[1]: *** No rule to make target `install'. Stop.

Workaround:
(second) changes in file <vlc>/contrib/my_gw/Makefile

old:
CMAKE = cmake . -DCMAKE_TOOLCHAIN_FILE=$(abspath toolchain.cmake) \
new:
CMAKE = cmake -G "MSYS Makefiles" . -DCMAKE_TOOLCHAIN_FILE=$(abspath toolchain.cmake) \

old:
echo "set(CMAKE_RC_COMPILER $(HOST)-windres)" >> $@
new:
echo "set(CMAKE_RC_COMPILER windres)" >> $@

start again:
cd <vlc>/contrib/my_gw/
rm -r game-music-emu
rm toolchain.cmake
make


21. Workaround problem in goom-2k4-0-src

Problem:
(cd goom-2k4-0-src && patch -p1) < ../../contrib/src/goom/goom2k4-0-win32.patch
patching file configure.in
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 76.
2 out of 2 hunks FAILED -- saving rejects to file configure.in.rej

Workaround:
dos2unix <vlc>/contrib/src/goom/goom2k4-0-win32.patch

start again:
rm -r goom-2k4-0-src
cd <vlc>/contrib/my_gw/
make


22. Workaround problem in libmad


Problem:
aclocal: macro `_LT_DECL_SED' required but not defined

workaround:
cd <vlc>/contrib/my_gw/libmad
rm aclocal.m4
rm Makefile.in
automake

start again:
cd <vlc>/contrib/my_gw/
make


23. Workaround problem in libmatroska-1.3.0

Workaround:
dos2unix <vlc>/contrib/src/matroska/matroska-pic.patch
dos2unix <vlc>/contrib/src/matroska/no-ansi.patch

start again:
rm -r libmatroska-1.3.0
cd <vlc>/contrib/my_gw/
make


24. Workaround problem in libmodplug-0.8.8.4


Problem:
mv: cannot move `libmodplug.pc.in.tmp' to `libmodplug.pc.in': Permission denied

Workaround:
Change the "< "$1" by editing <vlc>/contrib/src/pkg-static.sh

old:
exec <"$1" >"$1.tmp" || exit $?

new:
exec >"$1.tmp" || exit $?

old:
done
echo "Libs: $PUBLIC $PRIVATE"

new:
done < "$1"
echo "Libs: $PUBLIC $PRIVATE"

start again:
cd <vlc>/contrib/my_gw/
make

25. Workaround problem in qt4

Problem(s):
The build script does not currently recognize all
platforms supported by Qt.
Rerun this script with a -platform option listed to
set the system/compiler combination you use.

Workaround:
Change the option (typo?) by editing <vlc>/contrib/src/qt4/rules.mak

old:
PLATFORM := -xplatform win32-g++

new:
PLATFORM := -platform win32-g++

old:
cd $< && $(XTOOLS) ./configure $(PLATFORM) -static -release -fast -no-exceptions -no-stl -no-sql-sqlite -no-qt3support -no-gif -no-libmng -qt-libjpeg -no-libtiff -no-qdbus -no-openssl -no-webkit -sse -no-script -no-multimedia -no-phonon -opensource -no-scripttools -no-opengl -no-script -no-scripttools -no-declarative -no-declarative-debug -opensource -no-s60 -host-little-endian -confirm-license
cd $< && $(MAKE) $(XTOOLS) sub-src
new:
cd $< && $(XTOOLS) ./configure.exe $(PLATFORM) -static -release -fast -no-exceptions -no-stl -no-sql-sqlite -no-qt3support -no-gif -no-libmng -qt-libjpeg -no-libtiff -no-qdbus -no-openssl -no-webkit -sse -no-script -no-multimedia -no-phonon -opensource -no-scripttools -no-opengl -no-script -no-scripttools -no-declarative -no-declarative-debug -opensource -no-s60 -confirm-license
cd $< && $(XTOOLS) make


! look for other fix in this file futher down to avoid long re-compiles!

26. Workaround problem cppcodemarker.cpp

An error happens in

<vlc>/contrib/my_gw/qt4/tools/qdoc3/cppcodemarker.cpp
which can be solved by adding hist include line in cppcodemarker.cpp
#include "ctype.h"




27. Workaround problem in libtheora


Problem:
aclocal: macro `_LT_DECL_SED' required but not defined

workaround:
cd <vlc>/contrib/my_gw/libtheora
rm aclocal.m4
rm Makefile.in
automake

start again:
cd <vlc>/contrib/my_gw/
make



27. create make file

cd <vlc>
./configure


28. create make file

cd <vlc>
make


29. Workaround problem vlc

Problem:
configure.ac:1: error: possibly undefined macro: dnl

Workaround:
cd <vlc>
autoreconf

Start again:
cd <vlc>
make

30. Workaround problem soundcloud.luac

Problem:
<MinGW>\run\bin\luac.exe: lua/playlist/soundcloud.lua:*: invalid escape sequence near '\.'

Workaround:
replace all backslashes ecnlosed in " with two backslashs

old:
and string.match( vlc.path, "soundcloud\.com/.+/.+" )
new:
and string.match( vlc.path, "soundcloud\\.com/.+/.+" )

old:
if string.match ( vlc.path, "soundcloud\.com" ) then
new:
if string.match ( vlc.path, "soundcloud\\.com" ) then

old:
if string.match( line, "window\.SC\.bufferTracks\.push" ) then
new:
if string.match( line, "window\\.SC\\.bufferTracks\\.push" ) then

old:
"window\.SC\.bufferTracks\.push.*" ..
new:
"window\\.SC\\.bufferTracks\\.push.*" ..

Start again:
cd <vlc>
make



31. Missing v8-parts

Problem:
... : undefined reference to `vp8_short_fdct4x4_mmx'

Workaround:
Edit file <vlc>/contrib/src/vpx/rules.mak


old:
--disable-vp8-decoder
new:
--enable-vp8-decoder

Start again:
cd <vlc>/contrib/my_gw
rm -r libvpx
make
cd <vlc>
make


32. Not found moc.exe

Problem:
/bin/sh: moc: command not found

Workaround:
add path <vlc>/contrib/<build>/bin into <vlc>/Makefile

old:
pkgdatadir = $(datadir)/vlc

new:
PATH += :<vlc>/contrib/<build>/bin
pkgdatadir = $(datadir)/vlc

Start again:
cd <vlc>
make

Alternative (better):
use ./compile, where configure put the right path as wrapper already into

cd <vlc>
./compile


33. Problem with qt4 / QApplication (and similar)

Only happes if not fixed before compiling qt4

Problem:
CXX libqt4_plugin_la-qt4.lo
qt4.cpp:29:24: fatal error: QApplication: No such file or directory

Cause is the missing option "--strip-program" in "install", which was used when compiling the qt4.

Workaround:
Replace "--strip-program" with a 2nd step using "-exec" parameter of "find"

Edit file
<vlc>/contrib/src/qt4/rules.mak

old:
do (cd $</include/Qt$${h} && find . -maxdepth 1 -type f \( -name '*.h' -o -name 'Q*' \) -exec install -D -s --strip-program="$(abspath $(SRC)/qt4/fix_header.sh)" -- "{}" "$(PREFIX)/include/qt4/Qt$${h}/{}" \;) ; \

new:
do (cd $</include/Qt$${h} && find . -maxdepth 1 -type f \( -name '*.h' -o -name 'Q*' \) -exec install -D -- "{}" "$(PREFIX)/include/qt4/Qt$${h}/{}" \; -exec "$(abspath $(SRC)/qt4/fix_header.sh)" "$(PREFIX)/include/qt4/Qt$${h}/{}" \;) ; \


Start again (long):
cd <vlc>/contrib/my_gw
rm -r qt4
make
cd <vlc>
make


Alternative (shortcut with "display"):
add also at the bottom of <vlc>/contrib/src/qt4/rules.mak

new:

qt4_workaround: qt4
for h in Core Gui Xml Network; \
do (cd $</include/Qt$${h} && find . -maxdepth 1 -type f \( -name '*.h' -o -name 'Q*' \) \
-exec echo "$(PREFIX)/include/qt4/Qt$${h}/{}" \; \
-exec install -D -- "{}" "$(PREFIX)/include/qt4/Qt$${h}/{}" \; \
-exec "$(abspath $(SRC)/qt4/fix_header.sh)" "$(PREFIX)/include/qt4/Qt$${h}/{}" \;) ; \
done

Start again (shortcut):
cd <vlc>/contrib/my_gw
make qt4_workaround
cd <vlc>
make




34. Problem with ../modules/plugins.dat


Problem:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Happens when running make in <vlc>/bin
./vlc-cache-gen.exe ../modules

Have not found the real problem, but "../modules/plugins.dat" is created even after the error

So workaround:
Block rebuild in Makefile by editing <vlc>/bin/Makefile

old:
.PHONY: ../modules/plugins.dat
new:
# .PHONY: ../modules/plugins.dat



35. hmm, strange
somehow vlc is small and does nothing


36. Compile 2nd try
cd <vlc>
extras/package/win32/configure.sh

./compile


37. Problem with <vlc>/modules/gui/qt4/dialogs/help.cpp

<vlc>/modules/gui/qt4
CXXLD libqt4_plugin.la
Creating library file: .libs/libqt4_plugin.dll.a
dialogs/.libs/libqt4_plugin_la-help.o: In function `~UpdateDialog':


Somehow solved via:

cd <vlc>/modules/gui/qt4
make clean
cd <vlc>
./compile


38. Problem with ../modules/plugins.dat

again, so nothing better

Like I understand this happens on i686 and/or K2 system and there is no solution for it yet

--> ok, let's debug

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37519
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Compiling vlc using MinGw/Msys

Postby Jean-Baptiste Kempf » 03 May 2012 18:06

You know that usually people use prebuilt contribs to avoid most of the work?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

sma
New Cone
New Cone
Posts: 8
Joined: 03 May 2012 00:36

Re: Compiling vlc using MinGw/Msys

Postby sma » 03 May 2012 19:12

... yes, first I tried it via cygwin, then via MinGw/Msys and prebuilds (i586), but got earlier or later problems, so I chose the long way and face them where I can see what happens. Also like the opportunity to getting known with git, trarballs, alocale and so on... :-)

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37519
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Compiling vlc using MinGw/Msys

Postby Jean-Baptiste Kempf » 04 May 2012 17:11

That's great, but tedious.

Did it work in the end?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

sma
New Cone
New Cone
Posts: 8
Joined: 03 May 2012 00:36

Re: Compiling vlc using MinGw/Msys

Postby sma » 08 May 2012 21:37

... something like yes, but see at bottom:

38b.
Findings (after some problems with developing enviroment):

Error happens after
cachegen.c:107: return 0;
which is the end of main

--> probably some destructor and/or damaged memory problem, very hard to track further...
Also: happens only when frist build or reset
maybe: http://code.google.com/p/phantomjs/issues/detail?id=365 (but I used qt-4.7.4.tar)


workaround:
Block deleting of cache-file
Edit <vlc>/bin/Makrefile.am

old:
./vlc-cache-gen$(EXEEXT) ../modules ; \

new:
./vlc-cache-gen$(EXEEXT) ../modules || echo " <-- ignore last error" ; \




Start again:
cd <vlc>
./compile

39. ./vlc
Despite the comment in <vlc>/INSTALL the vlc.exe does not work from here. Reason: cannot find the plugins in <vlc>/modules


workaround:
cd <vlc>
VLC_PLUGIN_PATH=../modules vlc

--> yeah !


Now creating a nice common vlc-folder for normal usage:
Good make target is "package-win-strip"
(you can save much time by doing all workarounds first):

cd <vlc>
make package-win-strip

40. install-exec-hook

Problem:
/bin/sh: -c: line 6: unexpected EOF while looking for matching `"'

workaround:
edit <vlc>/Makefile.am

old:
PATH=$(DESTDIR)$(bindir):$$PATH" \

new:
PATH="$(DESTDIR)$(bindir):$$PATH" \

Start again:
cd <vlc>
make package-win-strip

41. vlc-cache-gen error

again

workaround:
edit <vlc>/Makefile.am

old:
"$(DESTDIR)$(vlclibdir)/plugins" ; \
new:
"$(DESTDIR)$(vlclibdir)/plugins" || echo " <-- ignore last error" ; \

Start again:
cd <vlc>
make package-win-strip

42. plugins not found

43.
cd <vlc>
make package-win-strip

Problem:
configure.ac:117: error: possibly undefined macro: AC_MSG_ERROR

Workaround:
cp /<drive>/<MinGW>/msys/1.0/share/aclocal/pkg.m4 <vlc>/npapi-vlc/m4


start again:
cd <vlc>
make package-win-strip

44. missing svn

Download:
http://sourceforge.net/projects/win32sv ... -1.7.4.zip


Extract all but "openssl.exe" into similar folder structure
<drive>:\<MinGW>\msys\1.0\

PS: "svn help" looks like wrong char-set, maybe other versions are better or it's a problem with openssl.exe or ...

start again:
cd <vlc>
make package-win-strip

--> Done !



Some notes about debugging:

1. set debug-option

Edit <vlc>/extras/package/win32/configure.sh

add Parameter:
"--enable-debug"

cd <vlc>
extras/package/win32/configure.sh
./compile


2. debug-infos for all
Since I wanted debug infos for all files (not only for bin/.libs/*) I blocked the "strip" by
edit <vlc>/libtool

old:
striplib="strip --strip-unneeded"

new:
#striplib="strip --strip-unneeded"
striplib="echo no-strip "

old:
STRIP="strip"

new:
#STRIP="strip"
STRIP="echo"


--> Everthing seems to work fine, but after closing the vlc.exe there will be an error.
I do not think that it was caused by my workarounds, could be a plattform-problem, could be something else ...

sma
New Cone
New Cone
Posts: 8
Joined: 03 May 2012 00:36

Re: Compiling vlc using MinGw/Msys

Postby sma » 09 May 2012 21:56

ok, I circled the problem to:

vlc/src/win32/plugin.c:87 handle = LoadLibraryW (wfile);

for the plugin: libdshow_plugin.dll

If I skip this file then I do not get the error --> anyone has an idea why this plugin causes an error when exit the program?
I assume some unloading problem, but have no clue for a good way to debug it...

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37519
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Compiling vlc using MinGw/Msys

Postby Jean-Baptiste Kempf » 14 May 2012 13:15

gcc version?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

sma
New Cone
New Cone
Posts: 8
Joined: 03 May 2012 00:36

Re: Compiling vlc using MinGw/Msys

Postby sma » 02 Jun 2012 18:24

gcc version 4.6.2 (GCC)
windows error messages refers to: libgcc_s_dw2-1.dll

Rémi Denis-Courmont
Developer
Developer
Posts: 15067
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Compiling vlc using MinGw/Msys

Postby Rémi Denis-Courmont » 02 Jun 2012 18:26

Smells like mismatched C++ ABIs.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

photonica
New Cone
New Cone
Posts: 8
Joined: 14 May 2012 21:18

Re: Compiling vlc using MinGw/Msys

Postby photonica » 04 Jun 2012 16:56

Hello, SMA,

Great writeup,

I have tried almost every platform suggested in the VlC docs and your process has gotten me the furthest, your methods of fixing the errors as they come has taught me what I simply did not understand.

your outlines for the directory structure was particularly helpful as this is where I always got hung up in the past with every other method.

i am up to somewhere around error 24 and, still going.

for one thing i did not know you could pick up where you left off in a build.

your instructions for picking apart a command and calling it manually were very informative.

A Big Thanks for taking the time to post.

obviously I cant say enough about all the people who have come before you as well, it is almost unfathomable the thousands of man hours that have gone into both the tools and the various platforms. it is truly amazing.

of course, at my level of understanding I am sure that most of the tutorials were simply over my head.

Yours just happen to connect with my method of learning. so... thanks again.

I have a simple question.

would you consider this a FULL build of VLC ?

i havent learned how to fully determine if a build has for example all the live555 functionality.

My goal is to have full Live555,full ffmpeg and full x264 encoding. for a project that will have similar functionality to the wowza platform.

perhpas you can point me in the right direction.

certainly i am much further along in understanding the overall source building process but I have a long way to go.

sma
New Cone
New Cone
Posts: 8
Joined: 03 May 2012 00:36

Re: Compiling vlc using MinGw/Msys

Postby sma » 06 Jun 2012 18:58

Hello photonica,

it's nice to see that this logging/description helped you.

Meanwhile I updated the code via svn/git and it seems that the desciption will not fit 100% anymore, but all new problems had the same pattern so I hope a similar workaround can be found easily.

A)
Maybe frist some words about the code structure as a kind of navigation help:

vlc has some "own" code and using a lot of other codings like standard c++-support, usual extentions and a lot of "other projects". The first part is included via installation of Mingw and its packages, the second via "url-->download-->copy".
The big part are the "other projects": You can use the pre-bulid contibs (see comment from Jean) or use "tarballs-->git-->compile". The last one is made as a kind of "build-in" into the configure/compile/make of vlc and is the way I have used. It also caused the main part of workarounds but includes all codings and builds of these packages.

B)
About your question: under

<vlc>/contrib/my_gw

you will find then the folders live555, ffmpeg, x264 (and more) which you can use separated from vlc too. Also you can

cd <vlc>/contrib/my_gw
make list

and only get&build the packages you really want. So in case you do not really need vlc this can be a good shortcut. Best look at the end in file <vlc>/contrib/bootstrap for short description of make tagets in the <vlc>/contrib/my_gw directory.

I am quite sure that I got all packages (=tarballs, =contrib/*-folders) installed and build correctly, so I would
answer your question with: yes.

My "only" problem left happens when it is linked together with "core vlc code" via shared libs (lib*.dll) and seems (strangly) affecting only the destuction (=exit) of the program. The hint about ABI-problem looks good, but needs some time, study and digging to find out more.

Hope it will help you to move on with your plans :-)
sma



@Remis: Thanks for the hint! Any good url/tool/way to check (and then get rid of) it? Currently I try wiki/abi-compliance-checker/google ...

nkoriyama
Cone that earned his stripes
Cone that earned his stripes
Posts: 338
Joined: 01 Sep 2011 20:50
VLC version: git
Operating System: Windows / Mac OS X
Location: Japan

Re: Compiling vlc using MinGw/Msys

Postby nkoriyama » 07 Jun 2012 13:56

gcc version 4.6.2 (GCC)
windows error messages refers to: libgcc_s_dw2-1.dll
I think you can execute properly If you copy "libgcc_s_dw2-1.dll" to the same directory where vlc.exe exists or under the PATH environment.
How To Ask Questions The Smart Way http://www.catb.org/~esr/faqs/smart-questions.html
My hack for ISDB-T http://sdrv.ms/126weue

photonica
New Cone
New Cone
Posts: 8
Joined: 14 May 2012 21:18

Re: Compiling vlc using MinGw/Msys

Postby photonica » 08 Jun 2012 19:21

hello,
thank you for responding.

your first comment is valid, the build workarounds are a bit different since it seems some of the packages have changed.

I am using a combination of your course and Jean B course in the VLC wiki.

I have had several new workarounds i had to do and yes, i used your rebuilding technique of removing the makefile and the m4 file and rebuilding. I guess the automake was not complete or some paths were not right during the build.
this is where going back to Jean B docs has helped.

right now i am stuck a bit in the VLC compile, certain .libs are not in place.

$ sh extras/package/win32/configure.sh --host=i686-pc-mingw32 --disable-nls --d
isable-dc1394 --disable-dca --disable-va

this would be my current configure line in vlc as i have stepped back to Jean B wiki and am attempting to work out these packages.

i am hanging on " checking for MINIZIP..."

each time a package is missing or can not be found i pull it out of the lineup if i dont need it. so far these are obsure packages i dont believe i need....

the build line is direct from JEAN b

"sh extras/package/win32/configure.sh --host=i686-pc-mingw32 --disable-nls"

i am thinking I may have a problem with my GNU build possible as some processes seem to be broken under the GNU i got during your process. i am still also convinced however that i am suffering from a poor tree identity.... that part is a bit confusing since many of the package documents refer to a generic linux or unix tree structure. this is where your documentation helped me the most.

i still think my paths are a problem,

any suggestions for path practices ?

i am a bit lost but today I am spending the day trying to get past MINIZIP untill i do.

at least now after your process i have a better understanding of what is happening behind the curtain :)

in reference to Jean B comment, about prebuilt i am in total understanding that " make all " or... " make " is a signification undertaking and that " make prebuilt " should be more pleasurable. i guess i am one of the brave ones.

having spent some time on the developers forums of VLC, I would say the VLC code itself is not without its daily political Gremlins. there are a lot of very generous people working on a great project in a selfish world and everyone including me has a personal agenda that directs their behavior.

that being said I believe that the only way to build VLC or any other opensource project consistently is to travel the hard road,
particularly if your like me, ignorantly persistent and a bit abscessed with a need to understand the secrets all around us every day.

so, you and i would possibly get along on an ideological level since... you took the hard road.

in the end I hope to be able to help someone else, and have a strong understanding of the VLC build that I wind up with.

In your last post, you commented about creating a svn/git.... not sure what that means but i guess your attempting to create a more consistent full build is that correct ?

Regards..
Jeff

photonica
New Cone
New Cone
Posts: 8
Joined: 14 May 2012 21:18

Re: Compiling vlc using MinGw/Msys

Postby photonica » 08 Jun 2012 19:47

i see now that
--host=i686-pc-mingw32 --disable-nls

this part added new errors and configure.sh complains about --host=

still getting random hangs on different package checks, but now not on minizip

i am going to try one of your other fixs prior to 36

photonica
New Cone
New Cone
Posts: 8
Joined: 14 May 2012 21:18

Re: Compiling vlc using MinGw/Msys

Postby photonica » 09 Jun 2012 00:03

well,good news

! it works .......

i get the same error when i close it but.... i will try the .dll placement if i can find it.

THANK YOU !

photonica
New Cone
New Cone
Posts: 8
Joined: 14 May 2012 21:18

Re: Compiling vlc using MinGw/Msys

Postby photonica » 09 Jun 2012 02:29

I wanted to point out that the versions reported by this event viewer appear to be wrong.
not sure if that is related.
I copied the libgcc....dll so it lives with VLC.EXE in the root of vlc-2.1.0-git <-- also listed wrong
that placement did not work.
I am thinking it is possible it might not happen on a machine without GCC installed.

i figured i would post this as it relates to this unresolved build issue.
I was pretty impressed with how nicely VLC buttoned up into the portable form with almost all the plugin modules.
who ever is responsible for that Good Job !

Code: Select all

Faulting application vlc.exe, version 2.1.0.0 time stamp 0x4fd27467 faulting module libgcc_s_dw2-1.dll, version 0.0.0.0 time stamp 0x4ed82a4d, exception code 0x40000015 fault offset 0x0001765a, process id 0x5e5fc application start time 0x01cd45d49dddb691
if i figure it out, i will post.
aside from the 48 work arounds for the person who wants a full build, this was the most comprehensive method for a windows native.
IMHO
thanks to all.

photonica
New Cone
New Cone
Posts: 8
Joined: 14 May 2012 21:18

Re: Compiling vlc using MinGw/Msys

Postby photonica » 10 Jun 2012 00:46

my latest findings indicate that it is not the VLC.EXE that is causing the crash on exit,
I switched out the VLC.exe that I made with the one from the binary offered on the VLC website and the same crash occured.
it worked the same way but crashed on exit
also, when i exit a batch command VLC doesnt exit normally, it remains as an active process.
if i end the process it doesnt crash.
the problem could be be in LIBVLCCORE.dll ......IE the mingw32 build of it.

sma
New Cone
New Cone
Posts: 8
Joined: 03 May 2012 00:36

Re: Compiling vlc using MinGw/Msys

Postby sma » 11 Jun 2012 21:18

Hello photonica,

congratulation that you made it!

About MINIZIP: I got many of similar "checking for MINIZIP... no" - messages. Like I understand this only checks and uses if it was found, but it can work without too.

Also I ignored some warnings like "configure: WARNING: Library libraw1394 >= 2.0.1 libdc1394-2 >= 2.1.0 needed for dc1394 was not found". Usually the message says who needs it and you can decide if you really need a workaround.

About "svn/git": I try to use eclipse for the vlc project, which supports svn source management and some other nice things. But it is annoying slow and needs too much of configuration to "understand" the code properly. But ast least you can get the latest version over svn and merge it into the workarounds.

About the libgcc_s_dw2-1.dll-error: I get it already when the dll-files are collected into plugins.dat (plugins.dat must be deleted)

cd <vlc>/bin/
rm ../modules/plugins.dat ; vlc-cache-gen.exe ../modules/

First I tried to identify the first .dll which causes the problem with some dirty coding of

<vlc>/src/modules/bank.c

When I let it skip the "../modules/access/dshow/.libs/libdshow_plugin.dll" here in function AllocatePluginDir then I havent got the error with "vlc-cache-gen.exe". Strangly but after the recent code update even this does not work anymore. I got with hello-debugger as far to the command

vlc/src/win32/plugin.c:87 handle = LoadLibraryW (wfile);

When I simply stopped the "vlc-cache-gen.exe" here after loading the libdshow_plugin.dll (via desparate and dirty coding) I got the error, stopping before this line and it was without the error. I guess that something during the unloading of this dll or some interaction between them (interrupt behavior?) or compatibility problems (ABI?) are causing it. At the moment I am thinking about trying an older compiler version of MinGw and do a compleate compile via ("make clean; make"). I'll post if I found out something new ... (or waiting that you will find the reason :-) )

Nevertheless: good luck!
sma



@nkoriyama: Thanks for the idea! It had not worked, but maybe you have another guess?

sma
New Cone
New Cone
Posts: 8
Joined: 03 May 2012 00:36

Re: Compiling vlc using MinGw/Msys

Postby sma » 11 Jun 2012 21:26

Hello photonica,

about your last finding: Can it be that you used the downloaded vlc.exe "in combination" with your compiled .dll / plugins.dat ? This would match my observation / guss that this error happend while destructing classes or unloading the dll's or similar...

sma

nkoriyama
Cone that earned his stripes
Cone that earned his stripes
Posts: 338
Joined: 01 Sep 2011 20:50
VLC version: git
Operating System: Windows / Mac OS X
Location: Japan

Re: Compiling vlc using MinGw/Msys

Postby nkoriyama » 12 Jun 2012 00:31

@nkoriyama: Thanks for the idea! It had not worked, but maybe you have another guess?
I'm not sure but you might need libstdc++-6.dll also.

As I read the thread, you don't use TDM-GCC. If you use TDM-GCC, the "libgcc_s_dw2-1.dll" error might be disappeared, I think.
Using Mingw's official gcc, libgcc_s_dw2-1.dll and libstdc++-6.dll are required for executing modules using C++.
Using TDM-GCC, libgcc_s_dw and libstdc++ are statically linked, so they are not required.

Anyway, native compilation with Mingw/Msys is not recommended, as it is rather complex. But if you enjoy to have hard time, I cannot stop you :D
Personally, I compile my own win32/win64 builds with Mingw-w64 toolchain on OS X.
I can compile win32/win64/osx/ubuntu builds on the same tree, on the same machine!
How To Ask Questions The Smart Way http://www.catb.org/~esr/faqs/smart-questions.html
My hack for ISDB-T http://sdrv.ms/126weue


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 2 guests