VOGONS

Common searches


DOSBox 0.70 crashes on me

Topic actions

Reply 40 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
gulikoza wrote:

You need directx headers for directx to be compiled. Check the configure...you should see some lines - checking for ddraw.h...

I have downloaded and extracted the latest DirectX SDK (dxsdk_feb2007.exe). I am a little unsure where to put them in my /mingw tree.

From various comments I found, it seems like I am supposed to copy the header files directly into /mingw/include, overwriting the following files:

-rw-r--r--    1 MiniMax    100838 Jan  8 15:30 ./d3d9.h
-rw-r--r-- 1 MiniMax 22164 Jan 8 15:30 ./d3d9caps.h
-rw-r--r-- 1 MiniMax 72337 Jan 8 15:30 ./d3d9types.h
-rw-r--r-- 1 MiniMax 2919 Jan 12 19:18 ./dxerr8.h
-rw-r--r-- 1 MiniMax 2968 Jan 12 19:18 ./dxerr9.h

But for the moment, I have installed the header files from the DXSDK in a sub-directory, in /mingw/include/DX, and have defined CPPFLAGS=-I/mingw/include/DX before running configure. This seems to work - somewhat 😒
ddraw.h is found and appears to be okay. But dsound.h and dinput.h throws warnings:

checking Win32 compiler... yes
checking ddraw.h usability... yes
checking ddraw.h presence... yes
checking for ddraw.h... yes
checking dsound.h usability... no
checking dsound.h presence... yes
configure: WARNING: dsound.h: present but cannot be compiled
configure: WARNING: dsound.h: check for missing prerequisite headers?
configure: WARNING: dsound.h: see the Autoconf documentation
configure: WARNING: dsound.h: section "Present But Cannot Be Compiled"
configure: WARNING: dsound.h: proceeding with the preprocessor's result
configure: WARNING: dsound.h: in the future, the compiler will take precedence
configure: WARNING: ## ------------------------------------------ ##
configure: WARNING: ## Report this to the AC_PACKAGE_NAME lists. ##
configure: WARNING: ## ------------------------------------------ ##
checking for dsound.h... yes
checking dinput.h usability... no
checking dinput.h presence... yes
configure: WARNING: dinput.h: present but cannot be compiled
configure: WARNING: dinput.h: check for missing prerequisite headers?
configure: WARNING: dinput.h: see the Autoconf documentation
configure: WARNING: dinput.h: section "Present But Cannot Be Compiled"
configure: WARNING: dinput.h: proceeding with the preprocessor's result
configure: WARNING: dinput.h: in the future, the compiler will take precedence
configure: WARNING: ## ------------------------------------------ ##
configure: WARNING: ## Report this to the AC_PACKAGE_NAME lists. ##
configure: WARNING: ## ------------------------------------------ ##
checking for dinput.h... yes
checking for yasm... no
checking for nasm... no
configure: creating ./config.status
config.status: creating Makefile

Looking inside the confg.log for more detais I see:

configure:20: checking ddraw.h usability
configure:32: gcc -c -O3 -s -mms-bitfields -march=i686 -Iinclude -I/home/MiniMax/src/SDL-1.2.11-src/include -D_GNU_SOURCE=1 -I/mingw/include/DX -Iinclude -I/home/MiniMax/src/SDL-1.2.11-src/include -D_GNU_SOURCE=1 conftest.c >&5
configure:38: $? = 0
configure:42: test -z
|| test ! -s conftest.err
configure:45: $? = 0
configure:48: test -s conftest.o
configure:51: $? = 0
configure:61: result: yes
configure:65: checking ddraw.h presence
configure:75: gcc -E -I/mingw/include/DX -Iinclude -I/home/MiniMax/src/SDL-1.2.11-src/include -D_GNU_SOURCE=1 conftest.c
configure:81: $? = 0
configure:101: result: yes
configure:136: checking for ddraw.h
configure:143: result: yes
configure:162: checking dsound.h usability
configure:174: gcc -c -O3 -s -mms-bitfields -march=i686 -Iinclude -I/home/MiniMax/src/SDL-1.2.11-src/include -D_GNU_SOURCE=1 -I/mingw/include/DX -Iinclude -I/home/MiniMax/src/SDL-1.2.11-src/include -D_GNU_SOURCE=1 conftest.c >&5
In file included from conftest.c:124:
C:/Spool/dxsdk_feb2007/Include/dsound.h:1899: error: redefinition of typedef 'LPDIRECTSOUNDFULLDUPLEX'
C:/Spool/dxsdk_feb2007/Include/dsound.h:175: error: previous declaration of 'LPDIRECTSOUNDFULLDUPLEX' was here

( /mingw/include/DX is mounted from C:\Spool\dxsdk_feb2007/Include)

Checking dsound.h shows that configure (gcc) is correct:

$ nl dsound.h | egrep '175      typedef|1899    typedef'
175 typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
1899 typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;

Any ideas why this is happening? Is it simply a case of bad coding by Microsoft, defining the same typedef twice (even if it is an identical definition)?

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 41 of 49, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
MiniMax wrote:
This means, that to build and run DOSBox, I need […]
Show full quote

This means, that to build and run DOSBox, I need

  1. a modified version of SDL (which explains the path-names listed in Qbix's diffs (SDL-1.2.11rel and SDL-1.2.11 - one for the official release, and one for an DOSBox-adapted version)
  2. to make sure that I don't accidential install the modified SDL.dll in my ordinary build envinronment, e.g. /mingw/bin.

You can be as strict as you want to be. (but it's not really needed)
in fact the sdl.dll is compiled on a different version of mingw then the release of dosbox. (I maked install to a different directory and edit the sdl-config)
the other support libs are even compiled on a different computer using an ancient version of mingw. (sdl_sound and related libs)

You can mix the compiled versions of SDL.dll without problems unless SDL changes their exported api. (which happened between the 0.63/65 sdl.dll version and the 0.70 version)
You can even compile dosbox and compile a new sdl.dll afterwards (for example having those patches in.) It depends a bit on what you change, but for small things it doesn't matter.

There are 2 directories mentioned in my patch as it was the easiest way of making the diff for you..

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

Reply 42 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

I don't deny that I am a control freak when it comes to configuration management. I spend so much time at work, trying to maintain a build-environment that will allow us to re-create our applications and databases from scratch. I want consistency, repeatability, script-ability, and documentation of the process. Keeping programs and files in non-standard location makes life a little complicated, but when it is all put into build-scripts it also serves a documentation for what is needed for the build, where it is located, how it is created, etc, etc.

If I can do this for DOSBox, then the next person that wants to have a look, or contribute code, will have a much easier task.

Qbix wrote:

There are 2 directories mentioned in my patch as it was the easiest way of making the diff for you..

The diff itself was fine, no problem. I just wanted some rationale for the changes.

As of now, I am stuck with a problem compiling SDL_dx5events:

/bin/sh ./libtool --mode=compile gcc -O3 -s -mms-bitfields -march=i686 -L/mingw/lib/DX -I/mingw/include/DX -Iinclude -I/home/MiniMax/src/SDL-1.2.11-src/include -D_GNU_SOURCE=1 -c /home/MiniMax/src/SDL-1.2.11-src/src/video/windx5/SDL_dx5events.c  -o build/SDL_dx5events.lo
gcc -O3 -s -mms-bitfields -march=i686 -L/mingw/lib/DX -I/mingw/include/DX -Iinclude -I/home/MiniMax/src/SDL-1.2.11-src/include -D_GNU_SOURCE=1 -c /home/MiniMax/src/SDL-1.2.11-src/src/video/windx5/SDL_dx5events.c -DDLL_EXPORT -DPIC -o build/.libs/SDL_dx5events.o
In file included from C:/MSYS/1.0/home/MiniMax/src/SDL-1.2.11-src/src/video/windx5/directx.h:82,
from C:/MSYS/1.0/home/MiniMax/src/SDL-1.2.11-src/src/video/windx5/SDL_dx5events.c:26:
C:/Spool/dxsdk_feb2007/Include/dinput.h:1298: error: redefinition of typedef 'DIDEVICEINSTANCE'
C:/Spool/dxsdk_feb2007/Include/dinput.h:1288: error: previous declaration of 'DIDEVICEINSTANCE' was here
C:/Spool/dxsdk_feb2007/Include/dinput.h:1301: error: redefinition of typedef 'LPCDIDEVICEINSTANCE'
C:/Spool/dxsdk_feb2007/Include/dinput.h:1299: error: previous declaration of 'LPCDIDEVICEINSTANCE' was here
C:/MSYS/1.0/home/MiniMax/src/SDL-1.2.11-src/src/video/windx5/SDL_dx5events.c: In function `DX5_CreateWindow':
C:/MSYS/1.0/home/MiniMax/src/SDL-1.2.11-src/src/video/windx5/SDL_dx5events.c:868: warning: cast to pointer from integer of different size
make: *** [build/SDL_dx5events.lo] Error 1

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 43 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Okay - I discarded the February 2007 DX-SDK from Microsoft, and installed these headers and libs from the SDL-site:

http://www.libsdl.org/extras/win32/common/dir … tx-devel.tar.gz

Now SDL compiles, and I can invoke DOSBox with SDL_VIDEODRIVER=directx.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 44 of 49, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Microsoft has some typedefs repeated in their headers. I assume their compiler happily accepts that so they haven't noticed, but gcc doesn't. This is a patch I apply to dx headers....
That SDL_dx5video change is needed for output=ddraw to work.

Attachments

  • Filename
    directx-mingw.diff
    File size
    3.43 KiB
    Downloads
    232 downloads
    File license
    Fair use/fair dealing exception

http://www.si-gamer.net/gulikoza

Reply 45 of 49, by franpa

User metadata
Rank Oldbie
Rank
Oldbie

just use the SDL file included in http://prdownloads.sourceforge.net/dosbox/DOS … er.exe?download

AMD Ryzen 3700X | ASUS Crosshair Hero VIII (WiFi) | 16GB DDR4 3600MHz RAM | MSI Geforce 1070Ti 8GB | Windows 10 Pro x64.

my website

Reply 46 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
gulikoza wrote:

Microsoft has some typedefs repeated in their headers. I assume their compiler happily accepts that so they haven't noticed, but gcc doesn't. This is a patch I apply to dx headers....

Thanks gulikoza - just what I needed. Together with the tip to use reimp (for all the Microsoft DX libraries?) that I found on your web-page, I believe there is a chance to get the MS DX SDK to work. But it will have to wait a bit - first I want to streamline the process using the files from libsdl.org, then I want to add SDL_net to my build, and whatever is need to make something that is equivalent to the official DOSBox distribution.

gulikoza wrote:

That SDL_dx5video change is needed for output=ddraw to work.

You are refering to this patch?

-#if 0 /* FIXME: enable this when SDL consistently reports lost surfaces */
+#if 1 /* FIXME: enable this when SDL consistently reports lost surfaces */
if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
video->flags |= SDL_HWSURFACE;
} else {

So specifying output=ddraw in the DOSBox configuration will expose this problem with lost surfaces?

Thanks - that is the kind of explanation I was looking for.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 47 of 49, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
franpa wrote:

My ambitions are a little higher. I might break my neck while climbing high, but I can enjoy the view while I climb.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 48 of 49, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

Reimp converts Visual Studio libs to gcc libs. It can be used for anything...
You actually should not need any DirectX libraries, unless you want to compile my Direct3D patch with shader support.

Yes, that was the patch I was referring to. Without it, dosbox will fail to create ddraw output ("Failed to create ddraw surface, back to normal surface.") because SDL_HWSURFACE flag is not set.

http://www.si-gamer.net/gulikoza

Reply 49 of 49, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

SDL_VIDEODRIVER=windib
is needed for NT4.0 sp 6 as well.

(email conversation with Stephan)

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