sdlcl icon indicating copy to clipboard operation
sdlcl copied to clipboard

Neverwinter Nights needs SDL_WaitThread

Open ghost opened this issue 8 years ago • 6 comments

After building on Ubuntu 16.04 and dropping it into the /lib folder for Neverwinter Nights, libmss then complains about SDL_WaitThread being an undefined symbol.

./nwn
./nwmain: symbol lookup error: ./miles/libmss.so.6: undefined symbol: SDL_WaitThread

Let me know what else you need.

ghost avatar Apr 26 '17 20:04 ghost

You could run the following command to show me all the functions needed by libmss, but I suspect I primarily need to implement the SDL threading functions for this to work.

$ nm -D /path/to/nwn/miles/libmss.so.6 | grep SDL_

MrAlert avatar Apr 27 '17 00:04 MrAlert

Here you go

nm -D miles/libmss.so.6 | grep SDL_
         U SDL_AudioDriverName
         U SDL_CDClose
         U SDL_CDEject
         U SDL_CDOpen
         U SDL_CDPause
         U SDL_CDPlay
         U SDL_CDResume
         U SDL_CDStatus
         U SDL_CDStop
         U SDL_CloseAudio
         U SDL_CreateThread
         U SDL_Delay
         U SDL_GetError
         U SDL_InitSubSystem
         U SDL_OpenAudio
         U SDL_PauseAudio
         U SDL_ThreadID
         U SDL_WaitThread
         U SDL_WasInit

ghost avatar Apr 27 '17 08:04 ghost

OK, all of those functions are implemented. See if it works now.

MrAlert avatar Apr 28 '17 23:04 MrAlert

Progress! ^.^ Make output:

Makefile:25: main.d: No such file or directory
Makefile:25: video.d: No such file or directory
Makefile:25: audio.d: No such file or directory
Makefile:25: audiocvt.d: No such file or directory
Makefile:25: timer.d: No such file or directory
Makefile:25: events.d: No such file or directory
Makefile:25: joystick.d: No such file or directory
Makefile:25: rwops.d: No such file or directory
Makefile:25: thread.d: No such file or directory
Makefile:25: cpuinfo.d: No such file or directory
Makefile:25: version.d: No such file or directory
Makefile:25: cdrom.d: No such file or directory
sed 's/SDL2_SYMBOL(\([^,]*\),.*/#define \1 re\1/' symbols.x > redir.h
sed 's/SDL2_SYMBOL(\([^,]*\),.*/#undef \1/' symbols.x > unredir.h
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM cdrom.c >cdrom.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM version.c >version.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM cpuinfo.c >cpuinfo.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM thread.c >thread.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM rwops.c >rwops.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM joystick.c >joystick.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM events.c >events.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM timer.c >timer.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM audiocvt.c >audiocvt.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM audio.c >audio.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM video.c >video.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32 -MM main.c >main.d
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o main.o main.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o video.o video.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o audio.o audio.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o audiocvt.o audiocvt.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o timer.o timer.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o events.o events.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o joystick.o joystick.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o rwops.o rwops.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o thread.o thread.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o cpuinfo.o cpuinfo.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o version.o version.c
cc -fPIC -Wall -Wextra -O2 `sdl2-config --cflags` -g -m32   -c -o cdrom.o cdrom.c
cc -shared -ldl -m32 -o libSDL-1.2.so.0 main.o video.o audio.o audiocvt.o timer.o events.o joystick.o rwops.o thread.o cpuinfo.o version.o cdrom.o

With NWMovies:

./nwn
./nwmain: symbol lookup error: ./nwmovies.so: undefined symbol: deflateEnd

Without NWMovies:

./nwn
Failed to initialize SDL Video: Error loading SDL

ghost avatar Apr 29 '17 11:04 ghost

Are you sure you have the 32-bit version of SDL2 installed? Because I didn't at first.

Also, just in case, I tested SDLCL with SDL 2.0.0. It was buggy as hell, but it did load. Need to figure out if it's that version of SDL that was buggy, or how SDLCL interacted with it.

As for the error with NWMovies, that looks like something to do with zlib which shouldn't have anything to do with SDL at all.

MrAlert avatar Apr 29 '17 21:04 MrAlert

Okay it starts now, after I used the 32bit SDL2 libraries in the Lutris runtime.

But there's no sound.

ghost avatar May 01 '17 14:05 ghost