VOGONS


First post, by SedrynTyros

User metadata
Rank Member
Rank
Member

So, I finally manage to teach myself enough to compile a DOSBox executable from source code that actually seems to work (well, it launches at least, I haven't done much testing beyond that yet), but I have some questions that I'm hoping the coding veterans here can answer. I've done some google searches but the problem is that most people who discuss compiling source code assume a level of knowledge that I don't yet have, so the answers I'm finding just lead to more questions!

So, what I did was I downloaded that latest MinGW using the automated mingw-get. Using info in the DOSBox wiki and from some other sources, I made several failed attempts to compile a Win32 build, but I eventually managed to piece together what I was doing wrong (I think). I then grabbed the SDL-devel-1.2.15-mingw32 pack and dropped it into my Home folder. Using MSYS, I changed to the SDL folder then ran "make native"; this seemed to add all the necessary files to my MinGW build environment. After that, I was able to compile a build by dropping the DOSBox source code into the Home folder, changing to that folder in MSYS, then running "./autogen.sh" followed by "./configure" and then "make".

This gave me a "dosbox.exe". I dropped it along with SDL.dll and SDL_net.dll into a folder thinking I'd be able to launch it, but I found out that I also need to have two other gcc libraries in the same folder; "libgcc_s_dw2-1.dll" and "libstdc++-6.dll". Once I added those dlls to the folder I was able to launch dosbox.exe.

First question I have is how do I add those two gcc libraries as static libraries during the compiling process? I've seen discussion on ways to do this but it's not clear to me where along in the process I should add the appropriate commandline arguments.

Second question is why is my dosbox.exe file is 14193KB?!! It's more than three times as large as every other dosbox.exe I've ever seen.

Thanks in advance for any help you can give me on this!

Reply 1 of 7, by P4R4D0X

User metadata
Rank Newbie
Rank
Newbie

This will link the libraries statically.

./configure LDFLAGS="-static-libgcc -static-libstdc++"

And the file is huge because it has debug information. You need to strip that to get a smaller executable.

strip dosbox.exe

Reply 4 of 7, by SedrynTyros

User metadata
Rank Member
Rank
Member

Thanks for the help, guys, and apologies for asking a question that's already been answered.

Much to my own amazement, I'm now finally able to compile my own DOSBox SVN and DOSBox SVN with Munt patch Win32 builds, in no small part because of all the helpful information I gathered from reading threads on this forum. It took me half a dozen attempts over the last four years to finally get the process right. I guess with enough perseverance you can actually teach an old dog new tricks! 😉

Reply 7 of 7, by David_OSU

User metadata
Rank Newbie
Rank
Newbie

I followed all the same steps you did, Sedryn, and I still can't get DOSbox to compile. A detailed "Compiling DOSbox with MinGW" tutorial would be helpful. Just installing MinGW and getting the SDL libraries installed was a big ordeal. For first-timers, this is really hard. What you wrote, "compiling source code assume a level of knowledge" is very true. I want someone to explain it to me like I'm a 5 year old.