Page 1 of 1

undefined reference to `_WinMain@16' error compiling VLC

Posted: 03 Jan 2009 13:53
by kurt
Hi all,
I am trying to modify VLC source code in order to include some extra funcionalities in it. I am working on Cygwin platform and since a few weeks, I am not able to compile it. I updated some libraries of Cygwin which may have caused the problem but I've downgraded them and the result was the same. This is the output of executing 'make' command:

make[2]: Entering directory `/home/mainuser/VLC/vlc-0.8.6e-source/modules'
Making all in access
make[3]: Entering directory `/home/mainuser/VLC/vlc-0.8.6e-source/modules/access'
make[4]: Entering directory `/home/mainuser/VLC/vlc-0.8.6e-source/modules/access'
if gcc -mno-cygwin -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/win32/include -I/usr/win32/include/ebml -D_OFF_T_
-D_off_t=long -DSYS_MINGW32 -I../../include `top_builddir="../.." ../../vlc-config --cflags plugin access_file
` -Wsign-compare -Wall -mms-bitfields -pipe -MT libaccess_file_plugin_a-file.o -MD -MP -MF ".deps/libaccess_f
ile_plugin_a-file.Tpo" -c -o libaccess_file_plugin_a-file.o `test -f 'file.c' || echo './'`file.c; \
then mv -f ".deps/libaccess_file_plugin_a-file.Tpo" ".deps/libaccess_file_plugin_a-file.Po"; else rm -
f ".deps/libaccess_file_plugin_a-file.Tpo"; exit 1; fi
rm -f libaccess_file_plugin.a
ar cru libaccess_file_plugin.a libaccess_file_plugin_a-file.o
ranlib libaccess_file_plugin.a
/bin/sh ../../libtool --tag=CC --mode=link gcc -mno-cygwin -Wsign-compare -Wall -mms-bitfields -pipe -L/usr/wi
n32/lib -o libaccess_file_plugin.dll libaccess_file_plugin.a -L/usr/local/lib -g -shared -u _vlc_entry__0_8_6
libtool: link: gcc -mno-cygwin -Wsign-compare -Wall -mms-bitfields -pipe -o .libs/libaccess_file_plugin.dll -g
-u _vlc_entry__0_8_6 -L/usr/win32/lib libaccess_file_plugin.a -L/usr/local/lib
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/lib/libmingw32.a(main.o):main.c:(.text+0x104):
undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
make[4]: *** [libaccess_file_plugin.dll] Error 1
make[4]: Leaving directory `/home/mainuser/VLC/vlc-0.8.6e-source/modules/access'
make[3]: *** [all-modules] Error 1
make[3]: Leaving directory `/home/mainuser/VLC/vlc-0.8.6e-source/modules/access'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mainuser/VLC/vlc-0.8.6e-source/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mainuser/VLC/vlc-0.8.6e-source'
make: *** [all] Error 2

I would highly appreciate any help.
Thank you in advance.

Regards!

Re: undefined reference to `_WinMain@16' error compiling VLC

Posted: 03 Jan 2009 15:26
by VLC_help
I suggest that you change to newer build. vlc-0.8.6e isn't supported anymore.

http://cygwin.com/ml/cygwin/1999-05/msg00352.html
might work.

Re: undefined reference to `_WinMain@16' error compiling VLC

Posted: 05 Jan 2009 18:57
by kurt
Thank you for your reply.
The problem is that all the modifications I've done in the source code are incompatible with the new releases.
I've tried doing what the link suggest but it still fails. The problem must be connected with some cygwin package version as I could compile it before updating them. I've already downgraded mingw-runtime, automake, binutils and libtool packages with no success. Any suggestion??
Thank you again.

Re: undefined reference to `_WinMain@16' error compiling VLC

Posted: 05 Jan 2009 19:12
by kurt
I've found that if I include an empty main in the file, the error disappears but then it complains about the next file. Should I include it in every file of VLC?? Does this have any consequence?? Can you find an alternative way of solving this??

Re: undefined reference to `_WinMain@16' error compiling VLC

Posted: 13 Jul 2010 20:29
by kj90
I'm having the same problem now. Did you ever find another solution to this?