[pygtk] undefined reference to `WinMain at 16' while compiling pygtk 1.99.16 on mingw (windows)
hh
mweiguo at gmail.com
Sun Feb 8 22:49:55 WST 2009
hi all:
i want to compile pygtk 1.99.16 on my pc(window xp) as follow:
$ LDFLAGS="-L/c/python22/libs -lpython22" CFLAGS="-march=pentium
-mms-bitfields -O2" CPPFLAGS=-I/c/python22/include ./configure
--build=i386-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc
checking for bind_textdomain_codeset... no
checking build system type... i386-pc-mingw32
checking host system type... i386-pc-mingw32
checking for some Win32 platform... yes
checking for native Win32... yes
checking for ld used by GCC... c:/mingw/mingw32/bin/ld.exe
checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld... yes
checking for c:/mingw/mingw32/bin/ld.exe option to reload object files... -r
checking for BSD-compatible nm... /mingw/bin/nm
checking for a sed that does not truncate output... /bin/sed
checking whether ln -s works... yes
checking how to recognise dependent libraries... file_magic file format
pei*-i386(.*architecture: i386)?
checking command to parse /mingw/bin/nm output... ok
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... no
checking dlfcn.h presence... no
checking for dlfcn.h... no
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -DDLL_EXPORT
checking if gcc PIC flag -DDLL_EXPORT works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking whether the linker (c:/mingw/mingw32/bin/ld.exe) supports
shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... Win32 ld.exe
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
checking for a Python interpreter with version >= 2.2... python
checking for python... /c/Python22/python
checking for python version... 2.2
checking for python platform... win32
checking for python script directory... c:\Python22\Lib\site-packages
checking for python extension module directory...
c:\Python22\Lib\site-packages
checking for headers required to compile python extensions... found
checking for python module thread... yes
checking whether to enable threading in pygtk... no
checking for pkg-config... /d/usr/gtk/bin/pkg-config
checking for GLIB - version >= 2.0.0... yes (version 2.18.4)
checking for pkg-config... (cached) /d/usr/gtk/bin/pkg-config
checking is pkg-config version >= 0.9.0... yes
checking for atk >= 1.0.0... yes
checking ATK_CFLAGS... -mms-bitfields -Id:/usr/gtk/include/atk-1.0
-Id:/usr/gtk/include/glib-2.0 -Id:/usr/gtk/lib/glib-2.0/include
checking ATK_LIBS... -Ld:/usr/gtk/lib -latk-1.0 -lgobject-2.0
-lgmodule-2.0 -lglib-2.0 -lintl
checking for pango >= 1.0.0... yes
checking PANGO_CFLAGS... -mms-bitfields -Id:/usr/gtk/include/pango-1.0
-Id:/usr/gtk/include/glib-2.0 -Id:/usr/gtk/lib/glib-2.0/include
checking PANGO_LIBS... -Ld:/usr/gtk/lib -lpango-1.0 -lgobject-2.0
-lgmodule-2.0 -lglib-2.0 -lintl
checking for pkg-config... (cached) /d/usr/gtk/bin/pkg-config
checking for GTK+ - version >= 2.0.0... yes (version 2.14.7)
checking for libglade-2.0 >= 2.0.0... checking for gtkgl-2.0 >=
1.99.0... checking for Numeric/arrayobject.h... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating pygtk-2.0.pc
config.status: creating codegen/Makefile
config.status: creating gtk/Makefile
config.status: creating docs/Makefile
config.status: creating codegen/pygtk-codegen-2.0
config.status: creating pygtk.spec
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
$ make
...
Making all in gtk
make[2]: Entering directory `/pygtk/gtk'
/bin/sh ../libtool --mode=link gcc -march=pentium -mms-bitfields -O2
-Wall -std=c9x -L/c/python22/libs -lpython22 -o _gtkmodule.la -rpath
c:\Python22\Lib\site-packages/gtk-2.0/gtk -module -avoid-version
-no-undefined -export-symbols-regex init_gtk _gtkmodule_la-gtkmodule.lo
_gtkmodule_la-gtkobject-support.lo _gtkmodule_la-gtk-types.lo
_gtkmodule_la-pygtktreemodel.lo _gtkmodule_la-pygtkcellrenderer.lo
_gtkmodule_la-gtk-fake-win32.lo _gtkmodule_la-gtk.lo
_gtkmodule_la-gdk.lo -Ld:/usr/gtk/lib -lgtk-win32-2.0 -lgdk-win32-2.0
-latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32
-lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0
-lglib-2.0 -lintl
rm -fr .libs/_gtkmodule.la .libs/_gtkmodule.* .libs/_gtkmodule.*
generating symbol list for `_gtkmodule.la'
dlltool --export-all --exclude-symbols
DllMain at 12,_cygwin_dll_entry at 12,_cygwin_noncygwin_dll_entry at 12,DllMainCRTStartup at 12,DllEntryPoint at 12
--output-def .libs/_gtkmodule.dll-def _gtkmodule_la-gtkmodule.lo
_gtkmodule_la-gtkobject-support.lo _gtkmodule_la-gtk-types.lo
_gtkmodule_la-pygtktreemodel.lo _gtkmodule_la-pygtkcellrenderer.lo
_gtkmodule_la-gtk-fake-win32.lo _gtkmodule_la-gtk.lo _gtkmodule_la-gdk.lo
sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" <
.libs/_gtkmodule.dll-def > .libs/_gtkmodule.exp
egrep -e "init_gtk" ".libs/_gtkmodule.exp" > ".libs/_gtkmodule.expT"
mv -f ".libs/_gtkmodule.expT" ".libs/_gtkmodule.exp"
if test "x`sed 1q .libs/_gtkmodule.exp`" = xEXPORTS; then cp
.libs/_gtkmodule.exp .libs/_gtkmodule.dll-def; else echo EXPORTS >
.libs/_gtkmodule.dll-def; _lt_hint=1; cat .libs/_gtkmodule.exp | while
read symbol; do set dummy $symbol; case $# in 2) echo " $2 @ $_lt_hint ;
" >> .libs/_gtkmodule.dll-def;; 4) echo " $2 $3 $4 ; " >>
.libs/_gtkmodule.dll-def; _lt_hint=`expr $_lt_hint - 1`;; *) echo " $2 @
$_lt_hint $3 ; " >> .libs/_gtkmodule.dll-def;; esac; _lt_hint=`expr 1 +
$_lt_hint`; done; fi
gcc -Wl,--base-file,.libs/_gtkmodule.dll-base
-Wl,-e,_DllMainCRTStartup at 12 -o .libs/_gtkmodule.dll
_gtkmodule_la-gtkmodule.lo _gtkmodule_la-gtkobject-support.lo
_gtkmodule_la-gtk-types.lo _gtkmodule_la-pygtktreemodel.lo
_gtkmodule_la-pygtkcellrenderer.lo _gtkmodule_la-gtk-fake-win32.lo
_gtkmodule_la-gtk.lo _gtkmodule_la-gdk.lo -L/c/python22/libs -lpython22
-Ld:/usr/gtk/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0
-lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0
-lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl
c:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
warning: cannot find entry symbol _DllMainCRTStartup at 12; defaulting to
00401000
/mingw/lib/libmingw32.a(main.o):main.c:(.text+0xbd): undefined reference
to `WinMain at 16'
collect2: ld returned 1 exit status
make[2]: *** [_gtkmodule.la] Error 1
make[2]: Leaving directory `/pygtk/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/pygtk'
make: *** [all] Error 2
is anyone can help?
greetings
More information about the pygtk
mailing list