KenniBlank / ShooterGame2D

Creating game in C like a chad
1 stars 4 forks source link

Compile the program for windows. (change compiler if need be) #6

Closed KenniBlank closed 17 hours ago

KenniBlank commented 1 day ago

I don't have a windows device to test on.
Create a method to create game.exe file with the given mainGame.c program. I want the program to be able to be run on WINDOWS too.

9x14S commented 1 day ago

I'll give it a try

9x14S commented 1 day ago

I'm having some trouble with compilation. Everything is going well up until the linking phase at which is errors out and says Undefined reference to WinMain. I'm still looking at it but I have no idea on how to fix this yet

9x14S commented 1 day ago

Okay got a successful build for Windows: image

I still got to figure out the install instructions since I've gone quite a lot back and forth to set this up

9x14S commented 1 day ago

I'll submit a PR in a moment

9x14S commented 1 day ago

PR #8

KenniBlank commented 1 day ago

Add changes of the Makefile to make .exe and send a PR.

Additionally, can you make it OS specific. I.e: create and run .exe on WINDOWS create and run ./game on Linux/Mac

Thanks

9x14S commented 18 hours ago

@KenniBlank I've submitted a PR adding support for Windows at #10 I've also removed the part where the game is run after compilation from the Makefile. I think it is better to leave the Makefile for compilation and then the user can run the game if they want (in case they just need to check if it compiles or not)

9x14S commented 18 hours ago

As for MacOS support, I don't really have any way of testing if it works but I believe it shouldn't be too different from Linux

KenniBlank commented 18 hours ago

I have removed the .gitignore file because I want the user to get right into the game rather than compile. For now lets keep it this way.

KenniBlank commented 17 hours ago

i checked on a windows machine and the .exe doesn't work. Try to fix it. Thanks

9x14S commented 17 hours ago

@KenniBlank Could you add more info? Are you using MinGW? What are the steps you've done to set up the project? And ".exe doesn't work" means that it compiles but doesn't work or that it doesn't compile?

KenniBlank commented 17 hours ago

Lemme check real quick

KenniBlank commented 17 hours ago

the make file has a error! It is using gcc for both windows and linux, it should be using mingw32 or mingw64

9x14S commented 17 hours ago

Yes because MinGW lets you install gcc through pacman

9x14S commented 17 hours ago

My bad, MSYS2 is the one that lets you install gcc through pacman. MinGW just provides the package

KenniBlank commented 17 hours ago

can you upload your version of game.exe

9x14S commented 17 hours ago

@KenniBlank https://www.mediafire.com/folder/46pi3lipfuwjn/ShooterGame2D (game compiled on my VM + libs) Let me know if you want me to add it to the project as a commit

KenniBlank commented 17 hours ago

Add it in.

9x14S commented 17 hours ago

Done #12

KenniBlank commented 17 hours ago

msys-2.0.dll was missing so I added it in. Also there seems to be the issue of double windows opening, (maybe compiler fault ) ( maybe code fault which I will check into) Thanks

9x14S commented 17 hours ago

At least it works right?

KenniBlank commented 17 hours ago

Yep.