===== Caution ===== * This is a machine-translated translation from Japanese, so some parts may not make sense. * If you have any questions about the content, please ask via Discord/X (Twitter)/email, etc. ===== Overview ===== * There is an application called Soda, which is a framework (or engine) for creating games using MiniScript. * https://github.com/JoeStrout/soda * This app is mainly made on Mac/Linux, so the build procedure on Windows is postponed. * Therefore, I created a procedure for building it myself. * Please note that the situation may change due to future pull requests, etc. (This description is as of 2025/02/11) * To make things easier, I will describe the steps to build a 64-bit environment only. If you want to build a 32-bit environment, please read the instructions separately. ===== Procedure ===== - Install MS Build Tools\\ https://learn.microsoft.com/ja-jp/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019#step-1---download-the-visual-studio-bootstrapper - 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 \\ - Place the SDL2 include file and library file in the build tool's load folder. \\ Note the following: (The reason will be explained later.) - Create an SDL2 folder in the include folder that is in the cl path, and store the SDL2 include files in it. - Store SDL2_image.h in the SDL2 folder in a. - Store SDL2_mixer.h in the SDL2 folder in a. - 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.\\ - Modify the source code (see commit B5294F6) - 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 ". \\ (If there are differences between the Linux environment and library construction, consider splitting it with directives.) - 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. - 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 - 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) {". - Run the VS Developer Command Prompt. \\ If you are building a 64-bit version, it is faster to run "x64 NativeToolsCommandPrompt". \\ 参考:https://none53.hatenablog.com/entry/2017/04/29/QT_%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%AB_C2001_%E5%AE%9A%E6%95%B0%E3%81%8C_2_%E8%A1%8C%E7%9B%AE%E3%81%AB%E7%B6%9A%E3%81%84%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82 - 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 ===== * Assert tests will not pass. (I think it may be treated as a different character.) * Solved. * https://qiita.com/TETSURO1999/items/3b50c99d2a0da41b667a