VOGONS


First post, by TeaRex

User metadata
Rank Member
Rank
Member

Hello,

if this was Linux I wouldn't have to ask for this but unfortunately I'm rather new to Win32 development stuff. What I'm trying to get to in the end is a one-file "thing" that runs one of a couple of older DOS programs of mine, out of the box without any installation, and without any outside dependencies beyond a standard Windows install. I had the idea of using dosbox with the physfs patch, and modifying that to use Resources embedded in the executable instead of external files. Basically "doing it the Mac way" without any user visible file clutter.

I'm stumbling at the first hurdle already: how to link a static dosbox executable with VC++ Express. Not static with respect to standard Windows dlls I mean, but one which has SDL, zlib, libpng etc. integrated, everything that I can't rely on to be present on other computers.

I assume I have to compile SDL from source for that? And then, how do I tell the VC++ linker to link things statically? And, is there something for windows like Linux's "ldd", which shows the dependencies of an executable?

I'm grateful for any help. I'm not asking you to do my job though, a hint on where to look for the answers should be enough.

tearex

Reply 1 of 14, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

If you have experiences with linux, why not use mingw32 as compiler? DOSBox supports it, and then you have your usual ./configure && make commands back. Using ./configure --enable-static should work.

BTW, the "mac" way is multiple files in a subdirectory that is simply shown as one file by the finder.

Reply 2 of 14, by TeaRex

User metadata
Rank Member
Rank
Member

I've managed to do the sort-of-static build by now. Just chose "lib" instead of "dll" in the SDL compilation configuration. Then add the previous external dependencies of SDL (winmm.lib and dxguid.lib) to those of DOSbox so the linking stage finds the necessary stuff. The result depends on nothing but standard windows and directx dlls, should work out of the box on any win32 system that has DirectX installed.

Why I'm not using Mingw? I've heard a lot of not-so-good things about its stability. Plus, does Mingw do windows resources stuff?

tearex

Reply 3 of 14, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Why I'm not using Mingw? I've heard a lot of not-so-good things about its stability.

I fear for the next version of dosbox then.

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 14, by TeaRex

User metadata
Rank Member
Rank
Member

Qbix, if you mean I shouldn't listen to hearsay you're right of course. But things did work out just fine with VC++, so I don't really see a need to switch compilers for the moment. I'm certainly not against open source as such and I wouldn't be using VC++ if it wasnt downloadable for free. And I have to learn my way around VC++ anyway, so why not use dosbox as the white rabbit for some experiments, I promise I won't dissect it while alive. 😉

tearex

Reply 5 of 14, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

I haven't had any problems with MinGW over the past year or so that I've been using it to compile DOSBox, SDL and other stuff. I'd like to hear some of the not-so-good-things.

Reply 6 of 14, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

mingw is stable and fast, and it supports everything the microsoft compiler supports (as long as we are talking about c/c++, not dotnet stuff). Including resources, arbitrary external DLLs and so on. Moreover, it has less bugs/a more complete c++ implementation than msvc.

Reply 7 of 14, by TeaRex

User metadata
Rank Member
Rank
Member
HunterZ wrote:

I'd like to hear some of the not-so-good-things.

See this discussion I had a short time ago concerning an Apple II emulator:

http://groups.google.com/group/comp.emulators … fc1cf3fa78b1819

tearex

Reply 8 of 14, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Well, in my four years experience with Exult (Ultima 7 engine), more things broke with the msvc version than with mingw.
This link doesn't really say much. Overall in my limited experience Mingw proved better than cygwin and not the other way round.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 14, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

He may be perfectly right, but from the context I guess his concerns seem to revolve around console mode apps. It's not a problem of mingw per se, but a limitation of their goals: cygwin wants to be a tool for porting unix apps (which makes it heavy), while mingw just wants to be a decent and slim compiler with a lot less portability aid. As DOSBox uses SDL for portability, it uses mingw the way it is meant.

Reply 11 of 14, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

Yeah as far as Cygwin versus MinGW, the latter makes more sense for DOSBox because DOSBox was designed from the ground up to be cross-platform. Cygwin is full of crutches for porting Unix apps to Windows, which add extra baggage (DLLs etc.).

The original question was VC++ versus MinGW though, I think. My guess (and it's just a guess) is that MSVC++ will optimize a little better, but MinGW is likely to have less problems due to the fact that it is gcc-based (like most of the other platforms DOSBox is supported on).

Reply 12 of 14, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

I really doubt MSVC optimizes better... gcc is already quite close to intel, and if anyone then intel knows how to optimize for their CPUs. GCC has a lot of high-level optimizations, sponsored by IBM and other noteworthy organizations. That's why I always recommend the latest possible gcc: It's progressing quite fast.