Compilation on Windows / CrossCompile

Everything related to the code /
Tout ce qui touche au code
Post Reply
milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Compilation on Windows / CrossCompile

Post by milipili » Sun Jul 20, 2008 8:56 pm

The compilation on Windows is broken since the r898. The allagro headers for Windows in the trunk are supposed to be for Visual Studio and not MinGW (houray for Allegro to have to launch an ugly and stupid batch script to fix the headers...).
Sorry for the disagreement, It will be fixed in a few revisions. I am still preparing TA3D for compiling with Visual Studio but don't worry the compatibility with MinGW will be kept.

In this way, it would be great to avoid complex nested if..else. Anyway they can often be replaced by a better code design.
Damien Gerard
Ta3d & Yuni Developer

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Tue Jul 22, 2008 5:00 am

It`s kind of sad, that you are addin different OS support and break windows support, since the main army of players are using windows :)

Well, take your time, since there are many changes in engine and MSVC is better than MinGw IMHO.

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Tue Jul 22, 2008 8:06 am

It is only temporary don't worry :)
And yes the compiler provided by VisualStudio is better than MinGW on Windows.
Damien Gerard
Ta3d & Yuni Developer

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Tue Jul 22, 2008 8:28 am

In fact I try to find out the dead lock in the same time :)
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Tue Jul 22, 2008 10:01 am

don't worry we're doing so many things at the same time that it breaks a few things sometimes (even on Linux ... but since we mostly develop on Unix like OSes it's fixed faster than on windows :P). It's hard not to break things :cry:
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Tue Jul 22, 2008 10:09 am

I`m know that, just not very patient :P

Vampiloup
Posts: 56
Joined: Thu Mar 20, 2008 9:13 am

Post by Vampiloup » Tue Jul 22, 2008 12:44 pm

Yes, some say your avatar is in actual photography.

No, not on the head

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Tue Jul 22, 2008 7:00 pm

Vampiloup wrote:Yes, some say your avatar is in actual photography.

No, not on the head
Yes, I also say so :D

shaddim
Posts: 11
Joined: Sat Sep 06, 2008 6:00 pm

Post by shaddim » Mon Sep 15, 2008 4:48 pm

Hello together,
tried to compile TA3d test 8 under windows with VS ... and up to now i was not very successful (endless header errors...).... what's the status about VS support?

greetings

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Mon Sep 15, 2008 5:02 pm

hmm the last time I tried with visual studio it was one year and an half ago or something like that ... I'll give it a try when I find time for this.
=>;-D Penguin Powered

Doors
Posts: 114
Joined: Wed Jan 09, 2008 7:53 pm
Contact:

Post by Doors » Mon Sep 15, 2008 11:34 pm

shaddim wrote:Hello together,
tried to compile TA3d test 8 under windows with VS ... and up to now i was not very successful (endless header errors...).... what's the status about VS support?

greetings
VS6 support - yeah its broken, very broken.

But mingw works great though.
Don't just look at the future through a window.
Open a door and go there.
http://ta3d.freedoors.org
http://www.freedoors.org
http://baencd.freedoors.org

shaddim
Posts: 11
Joined: Sat Sep 06, 2008 6:00 pm

Post by shaddim » Thu Sep 18, 2008 9:21 am

hello together,

First to all, i'm a pretty unexpierienced in solving unix'oid build problems, but i switched to mingw, to the prepacked version of Doors, MinGW-Ta3d.7z, which i found on his side. (Thank you!)

what i did:
exchanged the ta3d v4.2 src against, the actual one v5.0 test 9
installed cmake into the mingw folder

cmake -G "MinGW Makefiles" worked on after some tries

the .\configure hint was not working, because an configure script was not found.
'mingw32-make all', was able to build until the fmod problem mentioned by doors on his page:

/home/Sources/ta3d
$ mingw32-make all
[ 3%] Built target fileformats
[ 4%] Built target logs
[ 5%] Built target i18n
[ 8%] Built target threads
[ 18%] Built target misc
[ 23%] Built target 3dtoolbox
[ 24%] Built target tdf
[ 25%] Built target ta3dmath
[ 28%] Built target tajpeg
[ 34%] Built target gui
[ 43%] Built target gfx
[ 45%] Built target particles
[ 50%] Built target ingame
[ 51%] Built target audio
[ 53%] Built target debuginfos
[ 54%] Built target console
[ 55%] Built target oldgui
[ 57%] Built target converters
[ 59%] Built target hpi
[ 60%] Built target stdafx
Linking CXX executable ..\3dmeditor.exe
Warning: .drectve `-defaultlib:LIBC ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBC ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBC ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBC ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBC ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBC ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBC ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Warning: .drectve `-defaultlib:LIBC ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
..\bin\libs\Windows\libaudio.a(manager.cpp.obj): In function `ZNSt6vectorIPN4TA3 D5Audio7Manager12PlaylistItemESaIS4_EE13_M_insert_auxEN9__gnu_cxx17__normal_iter atorIPS4_S6_EERKS4_':
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allo cator.h:(.text+0x27): undefined reference to `FMOD_Channel_Stop@4'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allo cator.h:(.text+0x35): undefined reference to `FMOD_Sound_Release@4'
..\bin\libs\Windows\libaudio.a(manager.cpp.obj): In function `ZN4TA3D5Audio7Mana ger9stopMusicEv':
C:/MinGW/home/Sources/ta3d/src/sounds/manager.cpp:438: undefined reference to `F MOD_Channel_Stop@4'
C:/MinGW/home/Sources/ta3d/src/sounds/manager.cpp:439: undefined reference to `F MOD_Sound_Release@4'
<snip>
collect2: ld returned 1 exit status
mingw32-make[2]: *** [3dmeditor.exe] Error 1
mingw32-make[1]: *** [src/CMakeFiles/3dmeditor.dir/all] Error 2
mingw32-make: *** [all] Error 2


looks for me like an linking error against c++ mangled functions,so i checked the fmodex.a etc. was in place... but not mentioned in the make rules here 'src/CMakeFiles/3dmeditor.dir/' so i added it, but helps not....
other theory: fmod version change? compiler discrepancy -> have to build fmod myself with my installed gcc?

thank you for suggestions!

Doors
Posts: 114
Joined: Wed Jan 09, 2008 7:53 pm
Contact:

Post by Doors » Thu Sep 18, 2008 9:45 am

shaddim wrote:hello together,

First to all, i'm a pretty unexpierienced in solving unix'oid build problems, but i switched to mingw, to the prepacked version of Doors, MinGW-Ta3d.7z, which i found on his side. (Thank you!)

what i did:
exchanged the ta3d v4.2 src against, the actual one v5.0 test 9
installed cmake into the mingw folder

cmake -G "MinGW Makefiles" worked on after some tries

the .\configure hint was not working, because an configure script was not found.
'mingw32-make all', was able to build until the fmod problem mentioned by doors on his page:

..\bin\libs\Windows\libaudio.a(manager.cpp.obj): In function `ZNSt6vectorIPN4TA3 D5Audio7Manager12PlaylistItemESaIS4_EE13_M_insert_auxEN9__gnu_cxx17__normal_iter atorIPS4_S6_EERKS4_':
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allo cator.h:(.text+0x27): undefined reference to `FMOD_Channel_Stop@4'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/ext/new_allo cator.h:(.text+0x35): undefined reference to `FMOD_Sound_Release@4'
..\bin\libs\Windows\libaudio.a(manager.cpp.obj): In function `ZN4TA3D5Audio7Mana ger9stopMusicEv':
C:/MinGW/home/Sources/ta3d/src/sounds/manager.cpp:438: undefined reference to `F MOD_Channel_Stop@4'
C:/MinGW/home/Sources/ta3d/src/sounds/manager.cpp:439: undefined reference to `F MOD_Sound_Release@4'
<snip>
collect2: ld returned 1 exit status
mingw32-make[2]: *** [3dmeditor.exe] Error 1
mingw32-make[1]: *** [src/CMakeFiles/3dmeditor.dir/all] Error 2
mingw32-make: *** [all] Error 2[/i]

looks for me like an linking error against c++ mangled functions,so i checked the fmodex.a etc. was in place... but not mentioned in the make rules here 'src/CMakeFiles/3dmeditor.dir/' so i added it, but helps not....
other theory: fmod version change? compiler discrepancy -> have to build fmod myself with my installed gcc?

thank you for suggestions!
You are missing libfmodex.a from src\tools\win32\mingw32\libs

the easiest way to fix this is to grab the 0.5.0 test 8 package.

http://ta3d.freedoors.org/Source/Ta3d%2 ... 0Mingw.exe

install/extract it out.

in the root directory of it C:\ta3dmingw double click on the msys.bat to launch mingw32. This opens mingw with a username of ta3d-dev under home.

cd source32

then run cmake from there. This is a working snapshot directly from my system and cleaned. I test by redownloading from my site, doing a fresh install on another drive letter then running cmake-gui and make. Do not use mingw32-make as this will cause random glitches for reasons beyond me but apparently cmake does not get along with mingw32-make and just loves make under mingw, select msys make files when given the choice.

It will complain about a single missing file, nl.dll, ignore this as it has no affect on compilation and the file is in the game directory anyway. The older mingw setup does not work well with the 0.5.0 series sourcecode so please go ahead and grab the new one.

to test play you can grab

http://ta3d.freedoors.org/Demo/Ta3d%200.5.0-T8.exe

and install/extract that. c:\games\ta3d by default. This archive contains test stuff from the tademo's added to a ta3d setup. It's good enough to test with but not to play long term with, for that you will need OTA so you can copy the data files from disc.

copy 3dmeditor.exe & ta3d-bin.exe or ta3d.exe depending on your source version to the games\ta3d direcotry and enjoy.
Don't just look at the future through a window.
Open a door and go there.
http://ta3d.freedoors.org
http://www.freedoors.org
http://baencd.freedoors.org

shaddim
Posts: 11
Joined: Sat Sep 06, 2008 6:00 pm

Post by shaddim » Fri Sep 19, 2008 9:24 am

Doors wrote:<snip>
You are missing libfmodex.a from src\tools\win32\mingw32\libs
thank you...that does the trick. :)
now i'm trying to get into the overall structure and the build system...

shaddim
Posts: 11
Joined: Sat Sep 06, 2008 6:00 pm

Post by shaddim » Wed Sep 24, 2008 2:16 pm

hello again,

slow but steady progress...
with the help of zuzuf i was able to do an mingw based profile under window, where it behave a little bit different to linux.

with that cmake command it worked:
cmake -DCMAKE_CXX_FLAGS:string="-g -O0 -pg" _other_parameters_ ./
(-p as parameter worked not, no gmon.out produced, also, with -O1 the compile failed completly)

additionally, the libgmon.a library has to be linked in and the gmon.h
compiling worked and after running an gmon.out was produced.

with "gprof ta3d.exe > profile.txt" an flat text profile is produced (under linux it seems to be more clever in assuming the executable)

then, i got the long standing problem that the timings inside were 0 always for all functions.

in various tutorials it is stated that the '-pg' switch has to be forwarded to compiler AND Linker, but ld.exe was not knowing that switch and is was not able the change the linker to gcc.
after some fiddeling around and changing the ld.exe which was used, it worked, mysteriously.

now i'm playing with the vector code... was able to insert inline assembly after some trouble with at&t syntax and the "clobber" list... :)
maybe something useful arise from that...

greetings

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Wed Sep 24, 2008 4:01 pm

I`m very interested in build under windows, since I use this OS. Thanks, man! I`ll keep looking for your success :)

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests