UFO:Alien Invasion
Technical support => Linux => Topic started by: MarcoBi on September 20, 2010, 03:11:50 pm
-
Hi Devs,
I'm currently attempting to cross compile latest git version (20/09/2010) from a custom Linux toolchain (MinGW-Cross-Env) to Windows.
with a
SDL_LIBS="`/opt/mingw/usr/i686-pc-mingw32/bin/sdl-config --libs` -lrtmp -lz -lws2_32 -lwinmm -lssl -lgdi32 -lcrypto -lws2_32 -lgdi32 -lcrypt32 -lz -lfreetype -lwinmm" ./configure --host='i686-pc-mingw32' --with-curl-config=/opt/mingw/usr/i686-pc-mingw32/bin/curl-config
I get this error while linking:
* [GAM] ... linking ()
* [UFO] ... linking (-L/opt/mingw/usr/i686-pc-mingw32/lib -lvorbis -lm -logg -lz -L/opt/mingw/usr/i686-pc-mingw32/lib -lcurl -L/opt/mingw/usr/i686-pc-mingw32/lib -L/opt/mingw/usr/i686-pc-mingw32/lib -lidn -lwldap32 -lws2_32 -lgcrypt -liconv -L/opt/mingw/usr/i686-pc-mingw32/lib -lgpg-error -lz -lgnutls -lws2_32 -lgcrypt -liconv -L/opt/mingw/usr/i686-pc-mingw32/lib -lgpg-error -ljpeg -L/opt/mingw/usr/i686-pc-mingw32/lib -lpng14 -lz -L/opt/mingw/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -mwindows -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid -lrtmp -lz -lws2_32 -lwinmm -lssl -lgdi32 -lcrypto -lws2_32 -lgdi32 -lcrypt32 -lz -lfreetype -lwinmm -mwindows -L/opt/mingw/usr/i686-pc-mingw32/lib -lSDL_image -ltiff -ljpeg -lmingw32 -lSDLmain -lSDL -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid -lpng14 -lz -mwindows -L/opt/mingw/usr/i686-pc-mingw32/lib -lSDL_mixer -lmikmod -lpthread -lsmpeg -lstdc++ -lmingw32 -lSDLmain -lSDL -liconv -luser32 -lgdi32 -lwinmm -ldxguid -lvorbisfile -lvorbis -lm -logg -lSDL_ttf -logg -lxvidcore -L/opt/mingw/usr/i686-pc-mingw32/lib -ltheora -logg -lintl -lxvidcore -lws2_32 -lwinmm -lgdi32 -lopengl32 -L/opt/mingw/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -mwindows -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid -lrtmp -lz -lws2_32 -lwinmm -lssl -lgdi32 -lcrypto -lws2_32 -lgdi32 -lcrypt32 -lz -lfreetype -lwinmm)
Warning: resolving _timeBeginPeriod by linking to _timeBeginPeriod@4
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
* [DED] ... linking (-lz -L/opt/mingw/usr/i686-pc-mingw32/lib -lcurl -L/opt/mingw/usr/i686-pc-mingw32/lib -L/opt/mingw/usr/i686-pc-mingw32/lib -lidn -lwldap32 -lws2_32 -lgcrypt -liconv -L/opt/mingw/usr/i686-pc-mingw32/lib -lgpg-error -lz -lgnutls -lws2_32 -lgcrypt -liconv -L/opt/mingw/usr/i686-pc-mingw32/lib -lgpg-error -lws2_32 -lwinmm -lgdi32 -L/opt/mingw/usr/i686-pc-mingw32/lib -lmingw32 -lSDLmain -lSDL -lwinmm -mwindows -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid -lrtmp -lz -lws2_32 -lwinmm -lssl -lgdi32 -lcrypto -lws2_32 -lgdi32 -lcrypt32 -lz -lfreetype -lwinmm)
debug-mingw32-i386/server/ports/windows/win_main.o: In function `Sys_Init':
/opt/src/ufoai/src/ports/windows/win_main.c:48: undefined reference to `_timeBeginPeriod'
collect2: ld returned 1 exit status
make: *** [ufoded] Errore 1
Ehm... to tell the truth I have _timeBeginPeriod@4 defined in winmm.a, anyway do I need to put -lwinmm in a particular place?
Thanks!
-
well - i don't know about that linking problem - maybe add the -lwinmm stuff to build/plattform_specific.mk
it would be very nice if you could test the patch for the new build system with mingw-cross-env. the patch is at http://mattn.ninex.info/files/newbuildsystem.diff
-
well - i don't know about that linking problem - maybe add the -lwinmm stuff to build/plattform_specific.mk
it would be very nice if you could test the patch for the new build system with mingw-cross-env. the patch is at http://mattn.ninex.info/files/newbuildsystem.diff
Do I need to apply it to latest git? I'm asking because of lot of "rejected" errors... { Reversed (or previously applied) patch detected! Assume -R? [n] }
-
I dont check to patch, but it is not yet applied to the repository.
-
yes, you have to apply it - but try to use git apply patch.diff
-
yes, you have to apply it - but try to use git apply patch.diff
I have configured with
./configure --enable-release --disable-signals --disable-backtraces --target-os=mingw32
and then tweaked a little mingw32.mk as
SO_EXT = dll
SO_LDFLAGS = -shared
SO_CFLAGS = -shared
EXE_EXT = .exe
CC_PATH = /opt/mingw/usr/i686-pc-mingw32
# TODO: config.h
CFLAGS += -DSHARED_EXT=\"$(SO_EXT)\"
CFLAGS += -DGETTEXT_STATIC
# Windows XP is the minimum we need
CFLAGS += -DWINVER=0x501
CURL_CONFIG ?= $(CC_PATH)/bin/curl-config
CURL_LIBS ?= $(shell $(CURL_CONFIG) --libs) -lrtmp -lssl -lcrypto -lz -lws2_32 -lwinmm -lgdi32
CURL_CFLAGS ?= $(shell $(CURL_CONFIG) --cflags)
SDL_CONFIG ?= $(CC_PATH)/bin/sdl-config
SDL_LIBS ?= $(shell $(SDL_CONFIG) --libs)
SDL_CFLAGS ?= $(shell $(SDL_CONFIG) --cflags)
OPENGL_CFLAGS ?=
OPENGL_LIBS ?= -lopengl32
PKG_CONFIG ?= $(CROSS)pkg-config
SDL_TTF_LIBS ?= $(call PKG_LIBS,SDL_ttf) $(call PKG_LIBS,freetype2)
SDL_TTF_CFLAGS ?= $(call PKG_CFLAGS,SDL_ttf) $(call PKG_CFLAGS,freetype2)
SDL_IMAGE_LIBS ?= $(call PKG_LIBS,SDL_image)
SDL_IMAGE_CFLAGS ?= $(call PKG_CFLAGS,SDL_image)
SDL_MIXER_LIBS ?= $(call PKG_LIBS,SDL_mixer)
SDL_MIXER_CFLAGS ?= $(call PKG_CFLAGS,SDL_mixer)
OPENAL_CFLAGS ?= $(call PKG_CFLAGS,openal)
OPENAL_LIBS ?= $(call PKG_LIBS,openal)
THEORA_CFLAGS ?= $(call PKG_CFLAGS,theora)
THEORA_LIBS ?= $(call PKG_LIBS,theora)
GLIB_CFLAGS ?= $(call PKG_CFLAGS,glib-2.0)
GLIB_LIBS ?= $(call PKG_LIBS,glib-2.0)
GTK_CFLAGS ?= $(call PKG_CFLAGS,gtk+-2.0)
GTK_LIBS ?= $(call PKG_LIBS,gtk+-2.0)
GTK_SOURCEVIEW_CFLAGS ?= $(call PKG_CFLAGS,gtksourceview-2.0)
GTK_SOURCEVIEW_LIBS ?= $(call PKG_LIBS,gtksourceview-2.0)
GTK_GLEXT_CFLAGS ?= $(call PKG_CFLAGS,gtkglext-1.0)
ufo_LDFLAGS += -lws2_32 -lwinmm -lgdi32 -lintl -lfreetype
ufoded_LDFLAGS += -lws2_32 -lwinmm -lgdi32
testall_LDFLAGS += -lwinmm -lgdi32
ufo2map_LDFLAGS += -lwinmm
ufomodel_LDFLAGS += -lwinmm
uforadiant_LDFLAGS += -lglib-2.0 -lgtk-win32-2.0 -lgobject-2.0 -lstdc++
but...
marco@MarcoBi:/opt/src/ufoai$ make
Platform: linux
Target: mingw32
Architecture: i386
Compiler: i686-pc-mingw32-cc
Targets: game testall ufo ufo2map ufoded ufomodel uforadiant uforadiant-brushexport
===> LD [base/game.dll]
===> LD [testall.exe]
===> LD [ufo.exe]
===> LD [ufo2map.exe]
===> LD [ufoded.exe]
===> LD [ufomodel.exe]
===> LD [radiant/uforadiant.exe]
release-linux-i386/uforadiant/tools/radiant/radiant/dialogs/about.cpp.o: In function `_Z7DoAboutv':
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:130: undefined reference to `__imp__gtk_micro_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:130: undefined reference to `__imp__gtk_minor_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:130: undefined reference to `__imp__gtk_major_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:140: undefined reference to `__imp__gtkglext_micro_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:140: undefined reference to `__imp__gtkglext_minor_version'
/opt/src/ufoai/src/tools/radiant/radiant/dialogs/about.cpp:140: undefined reference to `__imp__gtkglext_major_version'
collect2: ld returned 1 exit status
make: *** [radiant/uforadiant.exe] Errore 1
I have only static libraries, so... do I need shared libraries? (that's not the case of mingw cross env)
Best reagrds
-
yes, in mingw32.mk is the pkg-config call for the libs of gtkglext missing.
-
btw. please post a diff when you fixed something on the makefile, not the full file.
-
btw. please post a diff when you fixed something on the makefile, not the full file.
Here is the patch for my modified mingw32.mk Makefile.
Can I repost my compilation attempt when I'll rebuild a shared version of the GTK stack in my cross compile env?
Bye!
-
yes, in mingw32.mk is the pkg-config call for the libs of gtkglext missing.
It's not missing, I have
GTK_GLEXT_CFLAGS ?= $(call PKG_CFLAGS,gtkglext-1.0)
GTK_GLEXT_LIBS ?= $(call PKG_LIBS,gtkglext-1.0)
Bye
-
you should add your the mingw-cross-env bin dir to your path then you don't have to patch the makefiles (see Makefile.local)
about the missing libs for mingw - that should not be added like this but like this:
ufo_LDFLAGS += -lws2_32 -lwinmm -lgdi32 -lintl -lfreetype
ufoded_LDFLAGS += -lws2_32 -lwinmm -lgdi32
testall_LDFLAGS += -lwinmm -lgdi32
ufo2map_LDFLAGS += -lwinmm
ufomodel_LDFLAGS += -lwinmm
uforadiant_LDFLAGS += -lglib-2.0 -lgtk-win32-2.0 -lgobject-2.0
-
there is still a problem in the makefiles about linking, even if i only type "make ufo" the game.so/dll is linked again.
-
you should add your the mingw-cross-env bin dir to your path then you don't have to patch the makefiles (see Makefile.local)
about the missing libs for mingw - that should not be added like this but like this:
ufo_LDFLAGS += -lws2_32 -lwinmm -lgdi32 -lintl -lfreetype
ufoded_LDFLAGS += -lws2_32 -lwinmm -lgdi32
testall_LDFLAGS += -lwinmm -lgdi32
ufo2map_LDFLAGS += -lwinmm
ufomodel_LDFLAGS += -lwinmm
uforadiant_LDFLAGS += -lglib-2.0 -lgtk-win32-2.0 -lgobject-2.0
I prefer to keep isolated a program I use to get a x-compiled binary from a x-compiled binary itself but you're right... keeping everythin in $PATH is a lot easier to manage!
Also if I don't add -lstdc++ in uforadiant_LDFLAGS I get a very long list of errors as shown in this attachment
-
well - i don't know about that linking problem - maybe add the -lwinmm stuff to build/plattform_specific.mk
it would be very nice if you could test the patch for the new build system with mingw-cross-env. the patch is at http://mattn.ninex.info/files/newbuildsystem.diff
OK, the new build system now works for me.
Just for reference:
- build shared GTK
- add -lstdc++ for uforadiant & uforadiant-brushexport
Now I only need to find how to compile maps and to find a way to package everything!
-
what is -lrtmp?
-
oh.. and please post a small patch - just that i won't miss anything
-
OK, the new build system now works for me.
Just for reference:
- build shared GTK
- add -lstdc++ for uforadiant & uforadiant-brushexport
Now I only need to find how to compile maps and to find a way to package everything!
RTMP is a streaming protocol and my libcurl got it as a dep because it was present at compile time, useless for ufoai anyway
-
then you should add this to config.mk
ufo_LDFLAGS += -lrmtp
ufoded_LDFLAGS += -lrmtp
testall_LDFLAGS += -lrmtp
this is imo more a problem of your curl-config file (where you can fix this of course, too)
-
then you should add this to config.mk
ufo_LDFLAGS += -lrmtp
ufoded_LDFLAGS += -lrmtp
testall_LDFLAGS += -lrmtp
this is imo more a problem of your curl-config file (where you can fix this of course, too)
I've found a better solution: recompile curl disabling rtmp support, it was in my toolchain only for MPlayer and vlc