目次

Caution

Overview

Procedure

  1. Download soda source code and SDL peripheral development API set (SDL2, SDL2_image, SDL2_mixer)
    For SDL2/image/mixer, download the zip named “devel-2.x.x-yyyy.zip”.
    soda: https://github.com/JoeStrout/soda
    SDL2: https://github.com/libsdl-org/SDL/releases/tag/release-2.32.0
    SDL2_image: https://github.com/libsdl-org/SDL_image/releases/tag/release-2.8.5
    SDL2_mixer: https://github.com/libsdl-org/SDL_mixer/releases/tag/release-2.8.1
  2. Place the SDL2 include file and library file in the build tool's load folder.
    Note the following: (The reason will be explained later.)
    1. Create an SDL2 folder in the include folder that is in the cl path, and store the SDL2 include files in it.
    2. Store SDL2_image.h in the SDL2 folder in a.
    3. Store SDL2_mixer.h in the SDL2 folder in a.
    4. Store all *.lib files contained in the library's “x64” directly under the “lib” folder on the build tool side.
      Store in the “x64” folder if compiling in 64bit.
  3. Modify the source code (see commit B5294F6)
    1. Modify the SDL_image loading folder
      This is because SDL2_image is assumed to be loaded directly. If you specify a path, this description is fine, but since “SDL2_image.h attempts to load under the assumption that SDL2.h is in the same folder,” prioritize this and modify the source code on the SODA side.
      Line 13 of SdlUtils.h, change it to “#include <SDL2/SDL_image.h>”.
      (If there are differences between the Linux environment and library construction, consider splitting it with directives.)
    2. Fixed the incorrect calculation for division in PixelDisplay
      Line 90 of PixelDisplay.cpp, change it to “if (denom == 0.0f) return 0.0f ;”.
      I plan to submit a pull request for this later.
    3. Fix the main function
      In Windows environments, it seems that the format of the main function is determined separately, and if the second argument is const, the format differs, so SDL-related libraries cannot be linked. The function definition needs to be changed. However, since it will affect if it can be compiled on Mac/Linux, I think it is better to branch with a directive.
      Line 332 of main.cpp, change it to “int main(int argc, char * argv[]) {”.
      Reference: https://www.glamenv-septzen.net/view/584
    4. In addition, there is a part in the main function that references the contents of c., so this has been corrected.
      Line 324 in main.cpp has been corrected to read “void PrepareShellArgs(int argc, char* argv[], int startingAt) {”.
    1. start VS Developer Prompt.
      Enter the following command.
cd soda
cd src
cl -I . -I MiniScript -I compiledData -I SDL2 /EHsc /wd4068 /source-charset:utf-8 /execution-charset:utf-8 ./*.cpp ./MiniScript/*.cpp ./compiledData/*.c /Fesoda.exe SDL2.lib SDL2main.lib SDL2_image.lib SDL2_mixer.lib Shell32.lib /link /SUBSYSTEM:console

Problem