dethrace icon indicating copy to clipboard operation
dethrace copied to clipboard

SDL2 error while compiling dethrace source!

Open ThunderNowX opened this issue 10 months ago • 17 comments

Image Image I have followed all steps, in main page, git clone, mkdir, build, etc.. but i still get those errors, how can i solve?

ThunderNowX avatar Feb 17 '25 20:02 ThunderNowX

  1. Download and extract SDL2-devel-2.30.11-VC.zip from libsdl-org/SDL somewhere
  2. Configure dethrace's CMake project with -DCMAKE_PREFIX_PATH=path/to/where/you/extracted/the/folder
  3. Build dethrace
  4. Copy SDL2.dll from the the devel archive (copy the correct architecture: 32-bit vs 64-bit) to the folder where you built dethrace.exe (both files are needed when playing the game)
  5. play the game (by copying dethrace.exe and SDL2.dll to the game data), or running the executable with a DETHRACE_ROOT_DIR environment variable set

madebr avatar Feb 17 '25 21:02 madebr

Do i need to copy exe and dll to my source? Or what

ThunderNowX avatar Feb 17 '25 21:02 ThunderNowX

Do i need to copy exe and dll to my source? Or what

If you have a dethrace.exe, that means you have successfully built dethrace. When running the game, you need both dethrace.exe and SDL2.dll in the same location.

madebr avatar Feb 17 '25 21:02 madebr

I just have zip with compiled game What i need is to compile the game itself

ThunderNowX avatar Feb 17 '25 21:02 ThunderNowX

May I suggest to try to follow this SDL2 CMake tutorial? https://www.youtube.com/watch?v=jkmDBZzchbQ

Building dethrace is 100% similar (SDL2 is the only external dependency)

madebr avatar Feb 17 '25 21:02 madebr

Can you tell me what is the error 233? In screen that i posted

ThunderNowX avatar Feb 17 '25 22:02 ThunderNowX

Can you tell me what is the error 233? In screen that i posted

dethrace's build script (=CMake) cannot find SDL2: we need a SDL2 library and the SDL2 headers.

CMake allows building dethrace inside Visual Studio SDL2 allows to do windows, keyboard, mouse, ... in a platform independent way

The tutorial I sent will show what needs to be configured for CMake to detect SDL2.

madebr avatar Feb 17 '25 22:02 madebr

I have got an PERL_EXECUTABLE error. How do i fix?

ThunderNowX avatar Feb 17 '25 22:02 ThunderNowX

With Visual Studio you can use vcpkg and install dependencies from there.

Sei italiano? vcpkg è il gestore delle dipendenze che in genere si utilizza con Visual Studio per facilità d'uso (sarà in grado di trovare tutte le dipendenze che installi con vcpkg).

  1. Scarica ed installa Git for Windows: https://git-scm.com/downloads/win;
  2. Installa vcpkg (per esempio in C:\ ) da PowerShell:
git clone https://github.com/microsoft/vcpkg
cd vcpkg
.\bootstrap-vcpkg.bat -disableMetrics
.\vcpkg integrate install
  1. Installa le dipendenze:
.\vcpkg install --triplet=x64-windows sdl2

Ad ogni modo questa porta sorgente attualmente funziona male... ho un PC discreto ma il gioco va a scatti, la velocità della visuale sembra legata agli fps (ho uno schermo 144 Hz) ma non riesco a limitare gli fps in modo regolare. La versione Windows 95 con cnc-ddraw (https://github.com/FunkyFr3sh/cnc-ddraw) per il momento funziona meglio.

Kappa971 avatar Feb 17 '25 22:02 Kappa971

Image And this?

ThunderNowX avatar Feb 18 '25 10:02 ThunderNowX

Image And this?

Cancella tutto e segui la guida che ho scritto sopra. NON devi scaricare e compilare SDL2 manualmente, puoi farlo tramite vcpkg.

Ti consiglio di utilizzare la versione di cmake integrata in Visual Studio, tramite interfaccia utente. Se invece preferisci usare la versione da linea comando, avvia un'istanza del prompt dei comandi per gli sviluppatori dal Terminale Windows ed esegui:

cmake --toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64 -B build
cmake --build build --config Release

Kappa971 avatar Feb 18 '25 10:02 Kappa971

I've installed StrawberryPerl on my system.

@jeff-1amstudios Can we make the Perl dependency optional, add pre-generated files to the repo, and let cmake automatically regenerate when the source changes?

madebr avatar Feb 18 '25 11:02 madebr

i am in game, but crash here

Image

ThunderNowX avatar Feb 18 '25 11:02 ThunderNowX

That's a legitimate bug. This needs a va_start and va_end before and after the call.

Our BRender fork is getting a major update ATM, so perhaps this has already been fixed by Jeff.

Unless you know how to fix this, I'd suggest to run the game in Release mode.

madebr avatar Feb 18 '25 12:02 madebr

Where i have to put va_start and va_end? Which lines

ThunderNowX avatar Feb 18 '25 12:02 ThunderNowX

Where i have to put va_start and va_end? Which lines

Questo è l'eseguibile compilato con Visual Studio 2022 + vcpkg: dethrace.zip

Image Image

Se vuoi seguire i miei consigli, riuscirai a far funzionare il gioco, altrimenti buona fortuna.

Kappa971 avatar Feb 18 '25 16:02 Kappa971

Fixed from myself Thanks anyway

ThunderNowX avatar Feb 18 '25 17:02 ThunderNowX