VOGONS


DOSBox build trouble

Topic actions

First post, by commodorejohn

User metadata
Rank Newbie
Rank
Newbie

So I'm trying to use MinGW on Fedora 10 to build a Windows DOSBox binary. I've had a couple minor issues, but nothing I can't sort out myself, until this:

g++  -g -O2    -o dosbox dosbox.o  cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a  hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a -lSDL_sound -lasound -lm -ldl -lpthread -lSDL -lpng -lz -lSDL_net -lX11 -lGL -lwinmm -lws2_32
/usr/bin/ld: cannot find -lwinmm
collect2: ld returned 1 exit status

I gather from Google that this is a Windows SDK library, but how do I go about setting that up on my Linux install?

Reply 1 of 7, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I thought mingw had different names usually for g++
Mine is called i586-msvc-g++
and mingw should come with that file as far as I know.

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

Reply 2 of 7, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Seems like it tries to link with the linux g++ and also include linux libraries like asound and X11.

Reply 3 of 7, by commodorejohn

User metadata
Rank Newbie
Rank
Newbie

Okay, after much prayer and fasting (read: tearing my hair out,) I got DOSBox to build in MinGW on Windows. The .exe file is where it should be, it starts up and runs fine, so I'm happy about that, at least. The one problem I have is that, for some baffling reason, the home-compiled version of the executable is a staggering 17.6 MB! (For comparison, the current Win32-installer-provided executable is 3.5 MB.) I'm at a loss to explain this. I didn't tell ./configure to enable debugging or anything, so where is all the extra .exe coming from?

EDIT: After a scan through the oversized executable, I'm seeing huge amounts of symbol and code text, so I'm thinking it built a debug version anyway. How can I explicitly forbid it from doing so?

Reply 4 of 7, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The default compile switches in the configure file are -g -O2, -g = debug information, so change the -g to a -s and you get no debug info and the symbols will be stripped. Make sure you do another configure command after changing the configure file. Also, if you prefer, you can do a "strip -s <exefile>" command to remove the debug info and symbols anytime after the executable is linked.

Reply 5 of 7, by commodorejohn

User metadata
Rank Newbie
Rank
Newbie

Ah. strip -s worked quite nicely, but I'll have to remember the option for the next time I rebuild. Thanks for your help!

Reply 6 of 7, by TeaRex

User metadata
Rank Member
Rank
Member

Also check whether you statically-linked some libraries that are dynamically linked in the official Windows build.

I don't know if this works with MinGW, but under real Unix-like OSes,

$ ldd /path/to/dosbox

shows which libraries are dynamically linked to DOSBox. If you don't see stuff like SDL or libz, those libraries might have been statically linked, so check your build process.

tearex

Reply 7 of 7, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

There's a Windows program called Dependency Walker, it can be found here:
http://www.dependencywalker.com/ it does pretty much what ldd does, it's free and rather useful.