Open Ben2917 opened 5 years ago
And also credit the creators of the OpenAL audio mod
Trying to build in WSL as a cross compliation, not presently working under Mingw.
If you're still alive, I can dump data.
Alive and kicking. I'd be happy to take a look
makefile lines 18-26 were changed to match compilers:
# compiler and flags
CC =i686-w64-mingw32-gcc
CXX =i686-w64-mingw32-g++
CXXFLAGS =-std=c++11 -Wall -Isrc $$(INCLUDES)
LDFLAGS =
# command for automatic dependency generation
DEPDIR =_AutoDependencies
MAKEDEPEND =i686-w64-mingw32-gcc -M -I. $$(CXXFLAGS) -o $$@ $$<
Then attempted
$> make release PLATFORM=Windows
Logs:
make all BUILD=release
make[1]: Entering directory '/mnt/c/Users/Dorian Greyson/git/mEldritch/Code'
make -C Libraries/Core BUILD=release
make[2]: Entering directory '/mnt/c/Users/Dorian Greyson/git/mEldritch/Code/Libraries/Core'
In file included from src/thread.cpp:2:0:
src/thread.h:4:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/mutex.cpp:2:0:
src/mutex.h:4:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
src/httpsocket.cpp:1:10: fatal error: WinSock2.h: No such file or directory
#include <WinSock2.h>
^~~~~~~~~~~~
compilation terminated.
In file included from src/exceptionuploadlog.cpp:3:0:
src/httpsocket.h:7:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
src/exceptionhandler.cpp:7:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/consolemanager.cpp:2:0:
src/consolemanager.h:13:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/consoleinput.cpp:2:0:
src/consoleinput.h:8:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/console.cpp:2:0:
src/console.h:5:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
src/xinputcontroller.cpp:7:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/windowwrapper.cpp:2:0:
src/windowwrapper.h:5:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/modmanager.cpp:9:0:
src/file.h:8:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
src/printmanager.cpp:11:10: fatal error: Windows.h: No such file or directory
#include <Windows.h> // For OutputDebugString
^~~~~~~~~~~
compilation terminated.
In file included from src/packstream.cpp:4:0:
src/file.h:8:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/mouse.cpp:2:0:
src/mouse.h:9:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
src/keyboard.cpp:9:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/inputsystem.cpp:4:0:
src/mouse.h:9:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/file.cpp:2:0:
src/file.h:8:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
src/display.cpp:6:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
src/customassert.cpp:7:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
In file included from src/configmanager.cpp:7:0:
src/consolemanager.h:13:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
src/clock.cpp:7:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
i686-w64-mingw32-g++ -std=c++11 -Wall -Isrc -I../../Libraries/zlib/src -I../../Libraries/Framework/src -O3 -fno-strict-aliasing -DBUILD_WINDOWS=1 -DGLEW_STATIC -m32 -c -o release/Windows/src/clock.o src/clock.cpp
src/clock.cpp:7:10: fatal error: Windows.h: No such file or directory
#include <Windows.h>
^~~~~~~~~~~
compilation terminated.
../../make_lib.mk:12: recipe for target 'release/Windows/src/clock.o' failed
make[2]: *** [release/Windows/src/clock.o] Error 1
make[2]: Leaving directory '/mnt/c/Users/Dorian Greyson/git/mEldritch/Code/Libraries/Core'
makefile:165: recipe for target 'Libraries/Core' failed
make[1]: *** [Libraries/Core] Error 2
make[1]: Leaving directory '/mnt/c/Users/Dorian Greyson/git/mEldritch/Code'
makefile:155: recipe for target 'release' failed
make: *** [release] Error 2
Running in WSL2, release data for Linux under WSL is:
$> lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
Any data you need I can make available with short delays.
Ran a quick test with just WSL's GCC and G++. Basically the same errors.
Thanks for pointing out this issue.
So if you checkout the branch cross-compiler-support that I've created that should fix the issue you've found here. Seems that the mingw linux cross compiler provides a "windows.h" file and it's case sensitive. I've changed all the instances in the code, along with a couple of other windows headers that had the same issue.
The problem now is that it seems to be quite hard to get an openal package for the mingw cross compiler. There'll also likely be problems with other libraries down the line if I'm not mistaken too. It's not impossible to solve this but it's out of the scope of this project.
Can I ask, is there a specific reason you're cross-compiling versus performing a build on windows directly?
Can I ask, is there a specific reason you're cross-compiling versus performing a build on windows directly?
Because I hate Windows' compilation toolchain from the top to the bottom, and also because I can quite literally install WSL2 four times over in the space just that toolchain takes. This is not an uncommon complaint. My hard drive is not large enough to say that 18 GB is expendable for the native toolchain, either.
[the rest]
I'll test this and get back to you. It may be a minute.
Haven't tested a windows build yet. Also want to update read me or wiki with list of dependencies for both platforms.