-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling from Linux for Windows #45
Comments
I've tried the first step, and Wine stops with an error, I guess I'm better off searching a windows machine to compile it. |
I tried calling the mingw inspired on the bat file that tries to call it. but it has been unsuccessfully, now I asked about it in RobertBeckebans/RBDOOM-3-BFG#340 to see if they knew anything about it... any idea ? |
Well mingw is useful for two cases, first to compile on windows using gcc and second to compile binaries that target windows on linux aka cross-compilling. The dhewm 3 readme gives you a good hint what you have to do:
Ofc, you have to adapt stuff as we dont have ddhewm3libs(omit that switch) with a mingw compiler in it, on ubuntu you can install a mingw compiler with the package mingw-w64. |
yes I've seen this, but where do I set all those "sets", can we make a "generator" that appears on the list of generators for the script to call it? where are those "generators" defined? |
You create a file called Toolchain.cmake or MyMagicUnicorn.cmake and put the settings in it, then you point to it with the -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain.cmake switch to it. The generators are defined by cmake itself, in theory you should be able to call the mingw generator once you have mingw installed. (probably have to close and reopen your shell once you installed mingw) |
ok so the *.sh file would read like something like this:
isn't it? and where should I save this prude "MyMagicUnicorn.cmake" file, alongside the scripts, or is there a more appropriate place? |
Placing the file is up to you, id probably place it alongside with the other cmake files inside of the neo directory and add -DCMAKE_TOOLCHAIN_FILE=../neo/Toolchain.cmake |
oh, now I see that OTE has already the mingw32.toolchain.cmake and the cmake-eclipse-mingw-debug.sh files! RBDoom3BFG lacks the toolchain, If the sh works I'll do a pull request so they have this also! |
oh snap! I don't have DirectX! :)
we might have to create a "if(unix)" section in FindDirectX.cmake ? |
My bad, completly missed those files. This one might be worth a try : http://stackoverflow.com/a/3817763 |
but Directx from 2007 isn't too old for BFG? is directx needed for the sound on Windows? if so can't we use OpenAl for Windows? |
Well you can always try to install newer versions of directx on wine, not 2016-08-07 1:58 GMT+02:00 Biel Bestué de Luna notifications@github.com:
|
a quick search in the code for the term "DirectX" reveals: directx is for ffmpeg and xaudio, can we pass without them as a testbed? deactivate them so no more DirectX for the moment? and see if it compiles |
Ffmpeg is disabled by default if i am not mistaken and xaudio is used for sound on windows only but i think you can turn it off and make the engine use openal instead ( not sure how well tested that is). Just give it a shot, we might aswell learn something from it :) |
I deactivated FFmpeg and forced OpenAL in CMakeLists.txt:
and in linux it compiles fine, audio works (as usually) and the videos no longer play but attempting to compile with mingw it keeps stoppping because the need for DirectX. could it be that DirectX is also used for input instead of SDL2 (it doesn't seem to be that way in the code but the fact that it attempts to search for a: "DirectX_XINPUT_LIBRARY", is this "xinput library" maybe a part of DirectX that handles mouse, keyboard and joystick/gamepad inputs? now apparently I'm also forcing SDL2, but maybe this gets ignored if we compile for Windows? |
yes examining CMakeLists.txt deeper. I see there are any SDL reference in MSVC (that I guess it's Windows) and there are references to DirectX, I wonder what would happen if I force SDL there in replacing any DirectX for SDL... |
See https://travis-ci.org/OpenTechEngine/OpenTechBFG/jobs/147780640 On Mon, Aug 8, 2016 at 6:50 PM, Biel Bestué de Luna <
|
this is exactly how I have the the script that calls cmake |
I did some searching for your problem and found a interesting comment in our main cmake file: if(NOT MSVC) on other platforms we must use openal because they don't have xaudio - and mingw is missing XAudio2.hFIXME: can we somehow have it default to OFF on windows and ON everywhere else?set(OPENAL TRUE) Maybe you can try getting the XAudio2.h from somewhere and place it in the appropriate place to make it compile? Also from what i could find, xinput seems to be replacement api for DirectInput. |
I'll try, I'm also attempting a cross-compiling on Dhewm3 which I'm facing with some additional problems. It's possible that we would need the binaries for SDL and even for Directx just like we have them for Dhewm3. in dhewm3 in the binaries pack more that having the complete code for OpenAL we have the c++ connection to OpenAL (just like how Doom3SDK had the c++ connection to the renderer) I wonder if so much reference to xinput means in Windows we're using directx for inptut instead of SDL2, I wish we could force SDL2. I wonder also if we can "set(OPENAL TRUE)" on MSVC (it doesn't seem to work though!) |
I don't quite understand the problem? OTE compiles with mingw on linux to windows just fine as seen on CI and we have releases automated from CI with tagged commits |
Yes, I was trying it with RBDoom3BFG trying to port the process to RBdoom3BFG, as I thought RBDoom3BFG would be far easier as it uses less external libraries, well I was completely wrong. Now I've seen there's a sh file: cmake-eclipse-mingw-debug.sh compiled fine, and triying in windows in needs all the dll generated from cegui it generated an OpenAL.dll which I copied too and when I try to enter it it needs a file named: "libgcc_s_seh-1.dll" |
Those files are gcc runtime dlls which you can find under mingw bin On Sun, Aug 14, 2016 at 8:29 PM, Biel Bestué de Luna <
|
OpenTechEngine.exe expects:
I couldn't find the first on the Mingw folder so I downloaded from the net but now OpenTechEngine.exe fails with what I guess it's a segfault for windows Is there a way to see the same content from a Linux console in Windows7? |
at least running in gdb shows the shell output, i'd expect the same from On Sun, Aug 14, 2016 at 10:13 PM, Biel Bestué de Luna <
|
what is gdb? |
The Gnu Project Debugger: https://www.gnu.org/software/gdb/ 2016-08-14 23:36 GMT+02:00 Biel Bestué de Luna notifications@github.com:
|
I might be in a position where I might have to compile OTE for windows, for a team that wants to do some mod for Doom3, now I don't have access to a Windows machine. I wonder can code be compiled following the compilation in the readme from within Wine? is there any option for a cross operating system compile solution, in Dhewm3 there was "mingw-w64" but I never used it, and I guess it was a cross operating system compiler?
The text was updated successfully, but these errors were encountered: