SGI: Development

Cant get DOSBox to compile - Page 1

It looks like others have got this to compile, but not me.

DOSBox 0.65
Compiling on SGI 2100 SSE GFX 4xR12K 300MHz 3.5gigs RAM
Irix 6.5.29 w/Dev foundation and libs
Using full Nekoware current install

Failing to resolve "dirname".

I've added -lgen to the linker env variable and configure picked it up and added it to the makefiles. Doesn't help.

Here's the complete error (compiling with gmake -j9):

gmake[3]: Entering directory `/usr/src/dosbox-0.65/src'
g++ -O3 -mips4 -mabi=n32 -L/usr/nekoware/lib -lgen -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 -lSDL_sound -L/usr/nekoware/lib -lSDL -lpthread -lpng -lz -lSDL_net -lGL
ld32: WARNING 84: /usr/lib32/libgen.so is not used for resolving any symbol.
ld32: WARNING 84: debug/libdebug.a is not used for resolving any symbol.
ld32: WARNING 84: /usr/lib32/libGL.so is not used for resolving any symbol.
ld32: ERROR 33: Unresolved text symbol "dirname" -- 1st referenced by dos/libdos.a(cdrom_image.o).
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: INFO 152: Output file removed because of error.
collect2: ld returned 2 exit status
gmake[3]: *** [dosbox] Error 1
gmake[3]: Leaving directory `/usr/src/dosbox-0.65/src'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/src/dosbox-0.65/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/src/dosbox-0.65'
gmake: *** [all] Error 2
[email protected]:/usr/src/dosbox-0.65#

Any ideas?
From your post I'm guessing that 'dirname' is in libgen ?
If so, it is probably the order of the included libraries that is the problem.
The order of the libraries on the compile/link line is important (and strict) on IRIX.

Nik.
How do I figure out what to adjust the order of the libraries to?
dkedrowitsch wrote:
How do I figure out what to adjust the order of the libraries to?


Move "-lgen" after "-lGL" and it should work.
Cool, I'll give that a try tonight! I wish I had an IRIX box at work. I should bring one of my Indigo2s in and hide it under my desk. :)

Thanks!
Hello,

I give it a go with MIPSpro 7.4.4.
I comes nearly easily till the end but it bombs on :

/usr/src/dosbox-0.65/src > CC -g -O3 -mips4 -Wl,-rpath,/usr/nekoware/bin -Wl,-rpath,/usr/nekoware/lib -Wl,-rpath,/usr/local/bin -Wl,-rpath,/usr/local/lib -L/usr/nekoware/lib -L/usr/local/lib -L/usr/lib32 -o dosbox dosbox.o cpu/libcpu.a debug/libdebug.a -lmx dos/libdos.a -lmx fpu/libfpu.a hardware/libhardware.a gui/libgui.a ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a -lSDL_sound -L/usr/nekoware/lib -lSDL -lpthread -lpng -lz -lSDL_net -lGL -lgen -lmx -lm
CC WARNING: -g conflicts with -O; changing to -O0; if you want -O, use -g3
ld32: WARNING 84 : debug/libdebug.a is not used for resolving any symbol.
ld32: WARNING 84 : /usr/lib32/libmx.so is not used for resolving any symbol.
ld32: WARNING 84 : /usr/lib32/libGL.so is not used for resolving any symbol.
ld32: ERROR 33 : Unresolved text symbol "lround(double)" -- 1st referenced by dos/libdos.a(cdrom_image.o).
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: INFO 152: Output file removed because of error.

I can't figure out how to make it compile there.

I have already replaced all the weird ar by CC -ar -o.
I have added to the line -lgen -lm -lmx to suppress some errors... but the lround remains.

Also I knwo it comes from <src>/src/dos/dos_image.cpp where I have added :
extern long int lround(double);
since it does not take it from <cmath>

Any idea?

@+

LoWeN

_________________
UX powered
I was having that problem w/gcc and just commented out the section of that function that called for lround() since it looked like it was only used in CDROM emulation or something. Figured I'd cross that bridge after I got the rest to compile and run.


Man I'd kill for an ISO of the MIPSPro 7.4.4 EOE CD. I have a valid licence and the FE CD, but the EOE didn't come with it. :(
Ok, I got it to compile with the suggestions! It runs now, but it looks like they keyboard is all messed up, as none of the keys do what they're supposed to. Some don't do anything, and most do alternate letters, numbers, or symbols. Almost like a keymap is all wrong.

Anyone else have this problem?
LoWeN wrote:
..
ld32: ERROR 33 : Unresolved text symbol "lround(double)" -- 1st referenced by dos/libdos.a(cdrom_image.o).
Use linker option -v to see when and which objects, archives and dsos are loaded.
ld32: INFO 152: Output file removed because of error.

I can't figure out how to make it compile there.

I have already replaced all the weird ar by CC -ar -o.
I have added to the line -lgen -lm -lmx to suppress some errors... but the lround remains.

Also I knwo it comes from <src>/src/dos/dos_image.cpp where I have added :
extern long int lround(double);
since it does not take it from <cmath>
LoWeN


No solution yet. The reason why lround() is not defined maybe is that its only available when using c99. But the source is c++ and so the CC is used. The -lm contains only a weak refererence to lround.

regards
Joerg

_________________
http://www.irixworld.net
Image Image
Hello,

Since I have maintenance contract with SGI.
I have opened a case for that.
As soon as I have a solution. I will post it.

@+

LoWeN

_________________
UX powered
Hello,

I got it.

Add the following line in src/dos/cdrom_image.cpp :

extern long int lround(double);
#pragma optional lround

On the final build for dosbox add -lgen -lm -lmx on the line.

Now the keyboard is all screwed up.
I will try to fix that.

@+

LoWeN

_________________
UX powered
Add the following to your dosbox.conf

Code:
[sdl]
usescancodes=false


That brings the keys back. I tried it first by using gcc and get it working that i can mount my /tmp directory under c: . After find out how to compile with mips pro this wont work anymore.


regards
Joerg

_________________
http://www.irixworld.net
Image Image
Hello,

Joerg I will try that tommorrow.

@+

LoWeN

_________________
UX powered
Well.... the basic stuff looks like to work when using GCC for compiling. I placed a binary under the following address ( http://www.irixworld.net/download/dosbox/ ) for those who are interessted in this. After the key works again i was able to produce a sample configuration file which looks currently like this one.

Code:
[sdl]
# fullscreen -- Start dosbox directly in fullscreen.
# fulldouble -- Use double buffering in fullscreen.
# fullresolution -- What resolution to use for fullscreen: original or fixed size (e.g. 1024x768).
# windowresolution -- Scale the window to this size IF the output device supports hardware scaling.
# output -- What to use for output: surface,overlay,opengl,openglnb.
# autolock -- Mouse will automatically lock, if you click on the screen.
# sensitiviy -- Mouse sensitivity.
# waitonerror -- Wait before closing the console if dosbox has an error.
# priority -- Priority levels for dosbox: lowest,lower,normal,higher,highest.
#             Second entry behind the comma is for when dosbox is not focused/minimized.
# mapperfile -- File used to load/save the key/event mappings from.
# usescancodes -- Avoid usage of symkeys, might not work on all operating systems.

fullscreen=false
fulldouble=false
fullresolution=original
windowresolution=original
output=surface
autolock=true
sensitivity=100
waitonerror=true
priority=higher,normal
mapperfile=mapper.txt
usescancodes=false

[dosbox]
# language -- Select another language file.
# memsize -- Amount of memory dosbox has in megabytes.
# machine -- The type of machine tries to emulate:hercules,cga,tandy,pcjr,vga.
# captures -- Directory where things like wave,midi,screenshot get captured.

language=
machine=vga
captures=/tmp
memsize=32

[render]
# frameskip -- How many frames dosbox skips before drawing one.
# aspect -- Do aspect correction, if your output method doesn't support scaling this can slow things down!.
# scaler -- Scaler used to enlarge/enhance low resolution modes.
#           Supported are none,normal2x,normal3x,advmame2x,advmame3x,advinterp2x,advinterp3x,tv2x,tv3x,rgb2x,rgb3x,scan2x,scan3x.

frameskip=0
aspect=false
scaler=none

[cpu]
# core -- CPU Core used in emulation: simple,normal,full.
# cycles -- Amount of instructions dosbox tries to emulate each millisecond.
#           Setting this higher than your machine can handle is bad!
#           You can also let DOSBox guess the correct value by setting it to auto.
#           Please note that this guessing feature is still experimental.
# cycleup   -- Amount of cycles to increase/decrease with keycombo.
# cycledown    Setting it lower than 100 will be a percentage.

core=full
cycles=2000
cycleup=500
cycledown=20

[mixer]
# nosound -- Enable silent mode, sound is still emulated though.
# rate -- Mixer sample rate, setting any devices higher than this will
#         probably lower their sound quality.
# blocksize -- Mixer block size, larger blocks might help sound stuttering
#              but sound will also be more lagged.
# prebuffer -- How many milliseconds of data to keep on top of the blocksize.

nosound=true
rate=22050
blocksize=2048
prebuffer=10

[midi]
# mpu401      -- Type of MPU-401 to emulate: none, uart or intelligent.
# device      -- Device that will receive the MIDI data from MPU-401.
#                This can be default,alsa,oss,win32,coreaudio,none.
# config      -- Special configuration options for the device. In Windows put
#                the id of the device you want to use. See README for details.

mpu401=intelligent
device=none
config=

[sblaster]
# sbtype -- Type of sblaster to emulate:none,sb1,sb2,sbpro1,sbpro2,sb16.
# sbbase,irq,dma,hdma -- The IO/IRQ/DMA/High DMA address of the soundblaster.
# mixer -- Allow the soundblaster mixer to modify the dosbox mixer.
# oplmode -- Type of OPL emulation: auto,cms,opl2,dualopl2,opl3.
#            On auto the mode is determined by sblaster type.
#            All OPL modes are 'Adlib', except for CMS.
# oplrate -- Sample rate of OPL music emulation.

sbtype=none
sbbase=220
irq=7
dma=1
hdma=5
mixer=true
oplmode=auto
oplrate=22050

[gus]
# gus -- Enable the Gravis Ultrasound emulation.
# gusbase,irq1,irq2,dma1,dma2 -- The IO/IRQ/DMA addresses of the
#            Gravis Ultrasound. (Same IRQ's and DMA's are OK.)
# gusrate -- Sample rate of Ultrasound emulation.
# ultradir -- Path to Ultrasound directory.  In this directory
#             there should be a MIDI directory that contains
#             the patch files for GUS playback.  Patch sets used
#             with Timidity should work fine.

gus=false
gusrate=22050
gusbase=240
irq1=5
irq2=5
dma1=3
dma2=3
ultradir=C:\ULTRASND

[speaker]
# pcspeaker -- Enable PC-Speaker emulation.
# pcrate -- Sample rate of the PC-Speaker sound generation.
# tandy -- Enable Tandy Sound System emulation (off,on,auto).
#          For auto Tandysound emulation is present only if machine is set to tandy.
# tandyrate -- Sample rate of the Tandy 3-Voice generation.
# disney -- Enable Disney Sound Source emulation.

pcspeaker=false
pcrate=22050
tandy=auto
tandyrate=22050
disney=true

[bios]
# joysticktype -- Type of joystick to emulate: none, 2axis, 4axis,
#                 fcs (Thrustmaster) ,ch (CH Flightstick).
#                 none disables joystick emulation.
#                 2axis is the default and supports two joysticks.

joysticktype=2axis

[serial]
# serial1-4 -- set type of device connected to com port.
#              Can be disabled, dummy, modem, directserial.
#              Additional parameters must be in the same line in the form of
#              parameter:value. Parameters for all types are irq, startbps, bytesize,
#              stopbits, parity (all optional).
#              for directserial: realport (required).
#              for modem: listenport (optional).
#              Example: serial1=modem listenport:5000

serial1=dummy
serial2=dummy
serial3=disabled
serial4=disabled

[dos]
# xms -- Enable XMS support.
# ems -- Enable EMS support.
# umb -- Enable UMB support (false,true,max).

xms=true
ems=true
umb=true

[ipx]
# ipx -- Enable ipx over UDP/IP emulation.

ipx=false

[autoexec]
# Lines in this section will be run at startup.
mount D "/CDROM" -t cdrom


Start the programm with ./dosbox /tmp" if would like to mount your temp directory under c:.

During playing with the inbuild capture (press ctrl+F5) function i hace recognized that the apps use a default 2x scaling. But disable this doesnt change anything speedwise, also playing with core cpu cycles and Frameskipping brings no improvement.

I can start some older games like stunt car racer, heros of might and magic2 or megaman but it looks without some optimization my 600mhz FUEL isnt fast enough.

Screenshot from MegaMan:
Image

Screenshots from M&M2:
Image
Image
Image

_________________
http://www.irixworld.net
Image Image
joerg wrote:
Well.... the basic stuff looks like to work when using GCC for compiling. I placed a binary under the following address ( http://www.irixworld.net/download/dosbox/ ) for those who are interested in this.


"1399:dosbox: rld: Fatal Error: Cannot Successfully map soname 'libSDL_sound-1.0.so.2' under any of the filenames ..."

I'm assuming this is neko_sdl_sound ? Almost installed it until I saw the prereqs ... any chance of compiling dosbox without sound ? Or instructions to accomplish that end ? Have a couple of useful DOS apps, SoftWindows is too goofy :-(
dkedrowitsch wrote:
It looks like others have got this to compile, but not me.

Failing to resolve "dirname".

I've added -lgen to the linker env variable and configure picked it up and added it to the makefiles. Doesn't help.


I'm having the same problem, what file and where abouts do I add -lgen to the linker env variable please? (I don't know what it looks like, I'm not much of a programmer so please be gentle!)
Just to revive this old beast...

I have been getting DOSBOX 0.65 building. With the help of this thread I have got it built and here is my findings.

Keymap doesnt work without having the following set in your dosbox.conf file (must be in same dir as the dosbox binary) :
Code:
[sdl]
usescancodes=false

From what I can tell there are some issues with the command line parsing. Here is the really weird bit, if I put a printf("moo\n"); in the " class MOUNT : public Program " section it actually runs all the commands (INTRO / MOUNT / etc). Without the printf() it just prints a blank line and returns to the 'dos' prompt.

Putting that randomness aside for the moment from what I can tell it doesn't seem to thing there is anything else after the first command. For example if I put in 'mount c /dosbox' it will show the mounted drives (the same as if you just type 'mount' on its own).

I am going to run it through cvd and see what I can work out. This was build using MIPSpro Compilers: Version 7.4.3m
Mare wrote:
Code:
[sdl]usescancodes=false

From what I can tell there are some issues with the command line parsing. Here is the really weird bit, if I put a printf("moo\n"); in the " class MOUNT : public Program " section it actually runs all the commands (INTRO / MOUNT / etc). Without the printf() it just prints a blank line and returns to the 'dos' prompt.

Hmmm - when I'd described my difficulty farther up, I'd indeed that line in my dosbox.conf. So, that doesn't seem to solve the problem by itself. However, I'll try your other suggestion - on the weekend, I'm going to put that weird printf in and recompile - curious if it'll work then...

_________________
The YOUNG get old, the OLD die -
that's what we've in common, not SGI.
i have this error with dosbox...

Quote:
Exit to error: Can't init SDL SDL not built with joystick support


any idea ?

Laurent

_________________
SGI or die !!!
:O2: :Octane2: :Octane: :Indigo2IMP: :Indigo2IMP: :Indigo: :Indigo: :Indy: :PI: :Crimson: :PWRSeries: :Onyx: :O2000R:
HP proliant DL 585 Quad Opteron dual core 2.5Ghz 16Gb
Quote:
Exit to error: Can't init SDL SDL not built with joystick support


Try uncommenting //#define DISABLE_JOYSTICK in src/gui/sdlmain.cpp:46, I would have thought there would have been a configure arg for disabling that.