Hi friends - it's been a while I've been working on my engine and it seems like it's ~2500 elo!!
Anyway, I've been trying to compile it for Windows, which has been an absolute headache since I've been developing it on Mac. Can anyone please give me some pointers on how to do it? I've been getting linking errors left and right, but it works perfectly fine on Mac.
As a sanity check, I've been able to run my exact code on repl.it (github here).
I was able to compile an EXE on my friend's PC just now, by removing the #ifdef in utils.h, but while the code compiles and links it gives a floating-point exception?? Even when I remove all of the code except for 'return 0'??
I wish I could donate all the hair I've been pulling out today haha
Bo Persson wrote: ↑Thu Jan 13, 2022 10:59 am
The ifdef is a bit odd. First of all, the predefined macro is _WIN32, not WIN32.
And second, I would avoid including the HUGE Windows.h in any header file. It is quite enough to add it to the cpp-file.
I guess it is possible to avoid the windows/unix headers entirely everywhere. As I understand, it is used to access the GetTickCount function, but since C++11, C++ provides high resolution monotonic timers that can be used instead of getTickCount.
Thank you to both of you for your valuable feedback - I just made the changes you suggested. The engine now compiles on my friend's Windows machine (after changing std=c++11 to std=gnu++0x in the makefile), but gives a floating-point exception, even when I remove all #includes and all code from the main function. Any ideas why that would happen? It has to be some compiler error the way I see it. It's driving me nuts lol
Also: if a program is not specifically written for MS VC++, I just compile it in MSYS2. I've never failed to build an engine MSYS2 if it builds in Linux. (Assuming I have/can find all the dependencies.) If an engine has a .vsproj or .sln file and no clear instructions on how to compile it on Linux (if this is even possible) then I don't even touch it. I don't have Visual Studio installed on my personal system (and I never will, as the main OS has been Linux for at least 8 months now).