How to compile SDLPoP for Windows?
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
How to compile SDLPoP for Windows?
How can people play on custom levels (with modified source code) on Windows?
On Linux, we can compile all and run ./prince through command line, but how to compile all into an EXE without having Windows installation?
On Linux, we can compile all and run ./prince through command line, but how to compile all into an EXE without having Windows installation?
Re: SDLPoP; David's open-source port of PoP
You could follow its Dev-C++ instructions, through Wine.atrueprincefanfrom18 wrote: ↑April 4th, 2021, 11:24 am[...], but how to compile all into an EXE without having Windows installation?
I also make the Windows executables for apoplexy with Dev-C++ through Wine.
It should also be possible to cross-compile using just the command-line, but I've never found a solid tutorial for that.
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: SDLPoP; David's open-source port of PoP
I had some issues with Wine for other stuff, so I created a virtual machine and it has Windows 10 on it. I got this far, but I'm not understanding what to do after downloading the ZIP files. It has a lot of files in it. Which ones to copy and paste? And mainly where?
This line says that I need to extract the contents of the i686-w64-mingw32 folder but there don't seem to have any folder with that name... I have to download the development libraries from both of the links right?
Re: SDLPoP; David's open-source port of PoP
Download the "tar.gz" files from the "development libraries" section in these 2 links.
https://www.libsdl.org/download-2.0.php
https://www.libsdl.org/projects/SDL_image/
Copy files from the "i686-..." folders from those archives into the "Dev-Cpp\MinGW64" folder.
https://www.libsdl.org/download-2.0.php
https://www.libsdl.org/projects/SDL_image/
Copy files from the "i686-..." folders from those archives into the "Dev-Cpp\MinGW64" folder.
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: SDLPoP; David's open-source port of PoP
Oh, the tar files? But why? I'm developing on Windows! Shouldn't I be downloading the Windows files? Anyway, I'll try this today.dmitrys wrote: ↑April 5th, 2021, 5:08 pm Download the "tar.gz" files from the "development libraries" section in these 2 links.
https://www.libsdl.org/download-2.0.php
https://www.libsdl.org/projects/SDL_image/
Copy files from the "i686-..." folders from those archives into the "Dev-Cpp\MinGW64" folder.
Re: SDLPoP; David's open-source port of PoP
Dev-CPP uses GNU C++. I believe ZIP files are for Visual Studio.
I have tried compiling it under VS and the EXE was significantly larger. It might have been my imagination but the game felt slightly laggier.
I have tried compiling it under VS and the EXE was significantly larger. It might have been my imagination but the game felt slightly laggier.
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: SDLPoP; David's open-source port of PoP
Sorry, I don't understand this. The i686... folder has three folders in it. What to to do with them? Or copy and paste the files from each of the folders to the respective folders in Dev-Cpp\MinGW64\?dmitrys wrote: ↑April 5th, 2021, 5:08 pm Download the "tar.gz" files from the "development libraries" section in these 2 links.
https://www.libsdl.org/download-2.0.php
https://www.libsdl.org/projects/SDL_image/
Copy files from the "i686-..." folders from those archives into the "Dev-Cpp\MinGW64" folder.
Re: SDLPoP; David's open-source port of PoP
Yes, just copy all the files/folders from each of the i686 folders into Dev-Cpp\MinGW64\.
Re: How to compile SDLPoP for Windows?
(I moved these posts into a separate thread.)
Re: SDLPoP; David's open-source port of PoP
Sorry that the readme is unclear.atrueprincefanfrom18 wrote: ↑April 6th, 2021, 8:32 am Sorry, I don't understand this. The i686... folder has three folders in it. What to to do with them?
Do what Dmitrys wrote.
I was implying that when you copy the bin, include, etc. folders to a place where folders with the same name already exist, then the contents of the corresponding folders are merged (recursively).
Both Total Commander and Windows Explorer do this, though the latter asks first if I want to merge.
I also realized that the path of the destination folder is not given explicitly.
And it's incorrect even: it's given as "the Dev-Cpp folder", but it should say the MinGW64 folder within it.
I will clarify the Readme.
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: How to compile SDLPoP for Windows?
No!!!
I tried for hours but failed...
It's very difficult to build the environment.
Can anyone please just compile this on Windows and upload/PM me?
Here's the file:
Sincerely appreciate your efforts!
I tried for hours but failed...
It's very difficult to build the environment.
Can anyone please just compile this on Windows and upload/PM me?
Here's the file:
Sincerely appreciate your efforts!
Re: How to compile SDLPoP for Windows?
Here is the compiled EXE (zipped).
It looks like you have the wrong version of the library installed (x64 instead of x86) based on the ".o" files that I had to delete.
No back button in the mod.
It looks like you have the wrong version of the library installed (x64 instead of x86) based on the ".o" files that I had to delete.
No back button in the mod.
- Attachments
-
- prince.zip
- (137.6 KiB) Downloaded 59 times
Re: How to compile SDLPoP for Windows?
Additionally they are in ELF format, but Dev-C++ creates *.o files in COFF format.
I think they were created when Amogh compiled SDLPoP for Linux.
They even contain an Ubuntu version string.
If I just press Compile on the files posted by Amogh, I get errors like this:
Code: Select all
[..]\ld.exe i386:x86-64 architecture of input file `main.o' is incompatible with i386 output
[..]\ld.exe i386:x86-64 architecture of input file `seg008.o' is incompatible with i386 output
[..]\ld.exe i386:x86-64 architecture of input file `seg007.o' is incompatible with i386 output
etc.
followed by:
[...]\seg008.o In function `get_image':
[...]\seg008.c (.text+0x8d7): undefined reference to `_printf_chk'
[...]\seg008.c (.text+0x8fc): undefined reference to `_printf_chk'
[...]\seg008.c (.text+0x915): undefined reference to `_printf_chk'
etc.
Dev-C++ sees that the *.o files are already there and newer than the corresponding *.c files, so it doesn't recompile them.
So it only tries to link the *.o files together into prince.exe, but that fails because the *.o files have a different architecture from what is set in the project file.
But even if I set the project to 64-bit, the "undefined reference" errors still appear.
The solution is to delete the *.o files.
In Dev-C++, the Rebuild All button does that, and then it compiles everything.
@Amogh,
1. What error messages did you get? Were they similar to what I show above?
2. If you press Rebuild All instead of Compile, does that compile SDLPoP without errors?
- atrueprincefanfrom18
- Site Shah
- Posts: 1786
- Joined: January 21st, 2020, 2:53 pm
- Contact:
Re: How to compile SDLPoP for Windows?
Thanks!
Sorry, didn't get it... What do you mean?
Yes, the attached ZIP is uploaded from a Linux computer, yes, were compiled for Linux.
Yes, I did try to rebuild it, but the common.h had problems, compiler was not finding <stdio.h>!
Maybe it was using g++ to compile instead of gcc. I tried to add the environment variables and tried running it too, but in the end, nothing was working, hence I gave up and requested here to compile it for me. And no, as I just mentioned, it was not able to find <stdio.h>, it couldn't compile.
Maybe if I just fix the compiler issue, it might work, but again, it was a lot of time consuming.
I guess there's a bit of lack of enough (written) documentation (and video documentation too). I couldn't really find a good video explaining what to do. Maybe David and/or dmitrys can record a video on how to set up the environment, it might be good for other people who want to develop a mod involving custom SDLPoP source code (and me too!).
Re: How to compile SDLPoP for Windows?
The left arrow key was not doing anything. Kid could only move forward.
All I have to do is install the Dev-CPP using its installer. And then copy the entire file/folder structure from i686-* folders in SDL2 and SDL_Image2 *mingw.tar.gz archives right into "Dev-CPP\MinGW-64\" folder. Delete any ".o" files in the src folder and do a rebuild. It should work.
Dev-CPP already comes with the GNU C/C++ compiler so no additional configuration is needed.
"port_release.dev" is the file to load when opening the project.
I use real Windows 10, not WINE though.
All I have to do is install the Dev-CPP using its installer. And then copy the entire file/folder structure from i686-* folders in SDL2 and SDL_Image2 *mingw.tar.gz archives right into "Dev-CPP\MinGW-64\" folder. Delete any ".o" files in the src folder and do a rebuild. It should work.
Dev-CPP already comes with the GNU C/C++ compiler so no additional configuration is needed.
"port_release.dev" is the file to load when opening the project.
I use real Windows 10, not WINE though.