1

I am following the meson build GuiTutorial from here:

https://mesonbuild.com/GuiTutorial.html

I am running Visual Studio 2019 express and python version 3.9.0 installed separately (that is not the one that comes with msys). I am using the x64 Native Tools Command Prompt for VS 2019. I followed the steps in the tutorial however I am getting a linking error in the last compilation step, below is the output:

c:\work\meson\test>meson compile -C builddir INFO: autodetecting backend as ninja INFO: calculating backend command to run: "C:\Program Files\Meson\ninja.EXE" -C C:/work/meson/test/builddir ninja: Entering directory `C:/work/meson/test/builddir' [1/1] Linking target sdlprog.exe FAILED: sdlprog.exe sdlprog.pdb "link" /MACHINE:x64 /OUT:sdlprog.exe sdlprog.exe.p/sdlprog.c.obj "/nologo" "/release" "/nologo" "/DEBUG" "/PDB:sdlprog.pdb" "subprojects\SDL2-2.26.5\libsdl2.a" "user32.lib" "gdi32.lib" "winmm.lib" "imm32.lib" "ole32.lib" "oleaut32.lib" "version.lib" "uuid.lib" "advapi32.lib" "setupapi.lib" "shell32.lib" "dinput8.lib" "user32.lib" "gdi32.lib" "winmm.lib" "imm32.lib" "ole32.lib" "oleaut32.lib" "version.lib" "uuid.lib" "advapi32.lib" "setupapi.lib" "shell32.lib" "dinput8.lib" "/SUBSYSTEM:WINDOWS" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib" MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) sdlprog.exe : fatal error LNK1120: 1 unresolved externals ninja: build stopped: subcommand failed.

  • How far into the tutorial did you get before hitting this error? Are you running through the steps in the "Creating the sample program" section or "Upgrading the program to use SDL"? – digby280 May 03 '23 at 13:55

0 Answers0