project-navigation
Personal tools

Author Topic: compile using MinGW  (Read 19885 times)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: compile using MinGW
« Reply #15 on: September 17, 2010, 02:40:55 pm »
i'm using mingw-cross-env to cross compile everything and link statically - our build bot should deliver binaries that uses a lot less dlls.

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: compile using MinGW
« Reply #16 on: September 18, 2010, 08:20:05 am »
> link statically
Tried that too
but in that case i have to recompile a lot more libs

> build bot
Do you plan to share nightly builds?
I've found some files in contrib, but ...

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: compile using MinGW
« Reply #17 on: September 18, 2010, 09:02:34 am »
I think, yes, nightlybuild. But both buildbot config, and makefiles need changes. Then contrib content is not yet ready for it.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: compile using MinGW
« Reply #18 on: September 18, 2010, 12:45:36 pm »
i'm still working on the makefiles and the buildbot config - if someone wanna help, let me know and i can publish the patches. getting the buildbot to compile binaries for every supported architecture would be the goal.

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: compile using MinGW
« Reply #19 on: September 23, 2010, 09:38:28 pm »
I'm able to link libs statically for every tool except radiant (as expected)

undefined reference to `_imp__gtk_micro_version' (and a lot more .... and more .... much more ..... )
It should be in libgtk-win32-2.0.a
but the compiled (mingw-cross-env-2.15) libgtk-win32-2.0.a doesn't contain this function
A MinGW compiled shared libgtk-win32-2.0.dll.a contains this function  ???

I'm using

--start-group
-lgtkglext-win32-1.0
-lgdkglext-win32-1.0
-lgtk-win32-2.0
-lgdk-win32-2.0
-lgdk_pixbuf-2.0
-lgtksourceview-2.0
-lgthread-2.0
-lpangowin32-1.0
-lpangocairo-1.0
-lpango-1.0
-latk-1.0
-lcairo
-lgmodule-2.0
-lglib-2.0
-lgobject-2.0
-lxml2
-luser32
-lgdi32
-lshell32
-lkernel32
-lintl
-lopengl32
-lopenal32
-lvorbisfile
-lvorbis
-logg
-lfontconfig
-lpng14
-ltiff
-ljpeg
-lws2_32
-liconv
-lz
-lwinmm
--end-group

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: compile using MinGW
« Reply #20 on: September 23, 2010, 10:11:23 pm »

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: compile using MinGW
« Reply #21 on: September 25, 2010, 12:01:57 pm »
Tried that already ;)

I than tried to build gtk+ on Win32 MinGW without success (its a pain)
than i've searched the root of the "problem"
and thats finally the solution (as dexcribed here)

We need something >like< that
ufoai/src/tools/radiant/radiant/dialogs/about.cpp
Line: 130 && 140
Code: [Select]
#ifdef static
g_snprintf(versionString, sizeof(versionString), "%i.%i.%i", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
#else
g_snprintf(versionString, sizeof(versionString), "%i.%i.%i", gtk_major_version, gtk_minor_version, gtk_micro_version);
#endif
............
#ifdef static
g_snprintf(versionString, sizeof(versionString), "%i.%i.%i", GTKGLEXT_MAJOR_VERSION, GTKGLEXT_MINOR_VERSION, GTKGLEXT_MICRO_VERSION);
#else
g_snprintf(versionString, sizeof(versionString), "%i.%i.%i", gtkglext_major_version, gtkglext_minor_version, gtkglext_micro_version);
#endif

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: compile using MinGW
« Reply #22 on: September 25, 2010, 01:25:04 pm »
why would that be needed? i mean, the if case - can't we just always use the macros from the headers?

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: compile using MinGW
« Reply #23 on: September 25, 2010, 01:58:35 pm »
You are right
radiant compiles even with dynamic libs

I was not sure ...

Edit

This tool is not ready to be linked statically
line 150 must also be edited
g_snprintf(versionString, sizeof(versionString), "%i.%i.%i", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);


This function is only available on a shared lib (I give up!)
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0x8c0): undefined reference to `_imp__g_threads_got_initialized'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0x8cb): undefined reference to `_imp__g_thread_functions_for_glib_use'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0x92f): undefined reference to `_imp__g_thread_functions_for_glib_use'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0xc76): undefined reference to `_imp__g_threads_got_initialized'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0xc81): undefined reference to `_imp__g_thread_functions_for_glib_use'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0xc9d): undefined reference to `_imp__g_threads_got_initialized'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0xca8): undefined reference to `_imp__g_thread_functions_for_glib_use'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0xcc6): undefined reference to `_imp__g_threads_got_initialized'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0xcd1): undefined reference
 to `_imp__g_thread_functions_for_glib_use'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0xd01): undefined reference to `_imp__g_threads_got_initialized'
.objs\radiant\src\tools\radiant\radiant\exec.o:exec.cpp:(.text+0xd0c): undefined reference to `_imp__g_thread_functions_for_glib_use'
.objs\radiant\src\tools\radiant\radiant\main.o:main.cpp:(.text+0x15f7): undefined reference to `_imp__g_threads_got_initialized'


even if i add every lib i have
i got tons of linker errors
« Last Edit: September 25, 2010, 05:27:03 pm by Muton »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: compile using MinGW
« Reply #24 on: September 26, 2010, 09:38:53 am »
the g_threads is an own lib - are you sure you linked that one, too (should be part of the pkg-config file, if not, fix that file instead any linker flags)

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: compile using MinGW
« Reply #25 on: September 26, 2010, 12:52:07 pm »
-lgthread-2.0
Afak C::B dont care about pkg_config

You need a shared lib to get this function
its not available on a static lib (--enable-static --disable-shared)

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: compile using MinGW
« Reply #26 on: November 07, 2010, 12:18:24 pm »
There was/is a discussion going on about the same topic here

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: compile using MinGW
« Reply #27 on: November 07, 2010, 12:58:11 pm »
I've made a new MinGW here

copy your gitsource below mingw; or use /etc/fstab to link it into mingw (you'll the wont see the folder using ls)
run ....\MinGW\msys.bat
move to the gitsource
./configure --help

Python2.7, 3.1 and msysgit is included + tons of dll's (mingw/bin)
mapget.py will run
Radiant can be build only shared while any ufo(tool) can be build static (--enable-static)

Tip:
Useful make command
Q=
verbose output like Wall
-B
force recompile (C::B rebuild)
-n
just show commands but dont to anything else
-jn
run n jobs simultaneously -j2 2 jobs