BSzili is correct, SdlAudioCDManager is part of ScummVM itself. So it's not a case of missing libraries. Is the makefile not building that part? Maybe the configuration script messed up.
Have you tried to clean the build? You can also check if you have sdl-audiocd.o in the build dir and its content (with "nm"). If file doesn't have symbols, remove it and compile again. Possibly some dependency is not working properly when you are switching between SDL versions. I had to deal with similar issues earlier and I had to remove manually some object files to sort it out.
There is an object file, but it hasn't been updated since August 2017, so it's not getting picked up at all while compiling, it seems. Also:
U SDL_CDClose
U SDL_CDOpen
U SDL_CDPlayTracks
U SDL_CDStatus
U SDL_CDStop
U SDL_GetError
U SDL_GetTicks
U SDL_InitSubSystem
U _Z7warningPKcz
0000014c T _ZN17SdlAudioCDManager4openEv
00000390 T _ZN17SdlAudioCDManager4playEiiiib
00000330 T _ZN17SdlAudioCDManager4stopEv
000002b4 T _ZN17SdlAudioCDManager5closeEv
000001cc T _ZN17SdlAudioCDManager6openCDEi
00000620 T _ZN17SdlAudioCDManager6updateEv
00000000 T _ZN17SdlAudioCDManagerC1Ev
00000000 T _ZN17SdlAudioCDManagerC2Ev
0000010c T _ZN17SdlAudioCDManagerD0Ev
000000a4 T _ZN17SdlAudioCDManagerD1Ev
000000a4 T _ZN17SdlAudioCDManagerD2Ev
U _ZN21DefaultAudioCDManager10openRealCDEv
U _ZN21DefaultAudioCDManager10setBalanceEa
U _ZN21DefaultAudioCDManager4openEv
U _ZN21DefaultAudioCDManager4playEiiiib
U _ZN21DefaultAudioCDManager4stopEv
U _ZN21DefaultAudioCDManager5closeEv
00000000 W _ZN21DefaultAudioCDManager6openCDERKN6Common6StringE
U _ZN21DefaultAudioCDManager6updateEv
U _ZN21DefaultAudioCDManager9setVolumeEh
U _ZN21DefaultAudioCDManagerC2Ev
U _ZN21DefaultAudioCDManagerD2Ev
00000560 T _ZNK17SdlAudioCDManager9isPlayingEv
U _ZNK21DefaultAudioCDManager9getStatusEv
U _ZNK21DefaultAudioCDManager9isPlayingEv
00000000 V _ZTI17SdlAudioCDManager
U _ZTI21DefaultAudioCDManager
00000000 V _ZTS17SdlAudioCDManager
00000000 V _ZTV17SdlAudioCDManager
U _ZTVN10__cxxabiv120__si_class_type_infoE
U _ZdlPv
There is a lot of DefaultAudioCDManager in there (that's the one from SDL2 iiuc), but only three instances of SDLAudioCDManager. I don't know how it should look like if it's correct, but obviously the file is too old or even mixed with two SDL versions.
Unfortunately removing that object file, doesn't make it being created new
I also keep forgetting about "clean", thank you for reminding me, will try that next.
Any idea how to deal with lseek() method? I need to offset filepointer by bytes to create new file with specific amount in size but the lseek result ends up with -1.
If I don't specify offset bytes, the file is created correctly but the size is incorrect as it needs to be
this is from lseek() method specs: Quote:
The lseek() function allows the file offset to be set beyond the end of the existing end-of-file of the file. If data is later written at this point, subsequent reads of the data in the gap return bytes of zeros (until data is actually written into the gap).
Some devices are incapable of seeking. The value of the pointer associ- ated with such a device is undefined.
if (cpos == ofs)
{
return;
}
else if (cpos > ofs)
{
fseek(fp, ofs, SEEK_SET);
}
else
{
long i;
long diff = ofs - cpos;
for (i = 0; i < diff; i++)
{
fputc(0, fp);
}
}
}
}
The fputc loop could be replaced with fwrite, but I wrote this as a quick workaround for NX Engine.
Edit: I just noticed that my example uses FILE pointers, but it can be rewritten to use lseek/write for file descriptors. I have a version for C++ iostreams too that I used in Arx Libertatis.
Edited by BSzili on 2019/2/23 15:46:48
This is just like television, only you can see much further.
Any idea how to deal with lseek() method? I need to offset filepointer by bytes to create new file with specific amount in size but the lseek result ends up with -1.
Just link the program with -lunix. By default lseek() will only allow seeking up to EOF, just like AmigaDOS. Enabling UNIX semantics changes this.
Apparently I had to comment out the line in SDK:newlib/include/math.h (I'm not saying you should!) that begins #define log2x(x) , in order to compile. If the end result seems to work, you'll see it at the friendly software distribution site soon.
edit: Done linking but program fails right at the start.
I did the double check and i completely removed that part of code AND amended the sdl-audiocd.o that was missing, but then the error simply changes towards a missing reference from the default-audiocd.o.
Yes, i did a reconfigure. It always picked up SDL2, no matter what i tried and ended up with changing a line in configure so it finally used SDL1, but i guess that isn't enough.
I added this line temporarily:
add_line_to_config_mk "USE_SDL2 = 0"
to configure after line 2478
amigaos*)
append_var LDFLAGS "-Wl,--export-dynamic"
append_var LDFLAGS "-L/sdk/local/newlib/lib"
# We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32
# as (unsigned) long, and consequently we'd get a compiler error otherwise.
type_4_byte='long'
# Supress format warnings as the long 4 byte causes noisy warnings.
append_var CXXFLAGS "-Wno-format"
--> here
add_line_to_config_mk 'AMIGAOS = 1'
_port_mk="backends/platform/sdl/amigaos/amigaos.mk"
;;
Which makes configure use (or at least it says so) SDL1.2.13, but maybe i have to change something else at another place as well?
1) I fetched the latest ScummVM sources from master, built it with my old configuration and it is using SDL2.
2) Since I couldn't find a configure switch to use SDL1, I hacked config.mk, commenting out whole "USE_SDL2= " line.
3) Then I modified include and linker line for SDL1 in config.mk.
4) Make clean + make
5) There was some compiler error regarding Image::writePNG - I simply removed USE_PNG temporarily because have no time to investigate that (could be my GCC4 or something else).
6) I also removed SDL_NET usage but just because I don't have the SDK installed currently.
Common problem with both systems is that a library check fails. I must have tried to force a configure script to accept one, but do not remember success and would not try it again. But for cmake it's pretty simple, even if the -i(nteractive) doesn't quite do it.