我在设置 sdl2 时在 vs 代码中遇到链接错误

问题描述 投票:0回答:0

我正在尝试将 sdl2 设置为 vs 代码,但出现以下错误:

Warning: PowerShell detected that you might be using a screen reader and has disabled PSReadLine for compatibility purposes. If you want to re-enable it, run 'Import-Module PSReadLine'.

PS C:\Users\91790\Desktop\templateSDL> make
g++ -I src/include -L src/lib -o main main.cpp -lmingw32 -lSDL2main -lSDL2
C:\Users\91790\AppData\Local\Temp\ccpT2dRR.o:main.cpp:(.text+0xf): undefined reference to `SDL_Init'
C:\Users\91790\AppData\Local\Temp\ccpT2dRR.o:main.cpp:(.text+0x43): undefined reference to `SDL_CreateWindow'
C:\Users\91790\AppData\Local\Temp\ccpT2dRR.o:main.cpp:(.text+0x51): undefined reference to `SDL_GetError'
C:\Users\91790\AppData\Local\Temp\ccpT2dRR.o:main.cpp:(.text+0x96): undefined reference to `SDL_PollEvent'
C:\Users\91790\AppData\Local\Temp\ccpT2dRR.o:main.cpp:(.text+0xb7): undefined reference to `SDL_DestroyWindow'
C:\Users\91790\AppData\Local\Temp\ccpT2dRR.o:main.cpp:(.text+0xbc): undefined reference to `SDL_Quit'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1
PS C:\Users\91790\Desktop\templateSDL> 
c++ visual-studio-code mingw sdl undefined-reference
© www.soinside.com 2019 - 2024. All rights reserved.