gpt4 book ai didi

c++ - SDL C++ 错误 c3861

转载 作者:行者123 更新时间:2023-11-28 01:34:40 26 4
gpt4 key购买 nike

我已经尝试了几个小时来解决这个问题,但我似乎无法想象它可能是什么,我第一次尝试设置 SDL,但我遇到了很多问题。我会在下面留下代码和错误,在此先感谢。

#include "SDL.h"

int main(int argc, char *argv[])
{

SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window *window = SDL_CreateWindow("title", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 400, SDL_WINDOW_SHOWN);
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0);

SDL_SetRendererDrawColor(renderer, 0, 255, 0, 255);

SDL_RenderClear(renderer);

SDL_renderPresent(renderer);

SDL_Delay(3000);

return 0;
}

随之而来的错误:

identifier "SDL_SetRendererDrawColor" is undefined    
identifier "SDL_renderPresent" is undefined
C3861 'SDL_SetRendererDrawColor': identifier not found
C3861 'SDL_renderPresent': identifier not found

在评论完这两个之后我明白了;

'My1stSDL.exe' (Win32): Loaded 'C:\Users\Aaron\Desktop\My1stSDL\x64\Release\My1stSDL.exe'. Symbols loaded.

'My1stSDL.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.

'My1stSDL.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.

'My1stSDL.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.

'My1stSDL.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find or open the PDB file.

'My1stSDL.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. Cannot find or open the PDB file.

The thread 0x64f4 has exited with code -1073741515 (0xc0000135). The thread 0x6634 has exited with code -1073741515 (0xc0000135). The thread 0x671c has exited with code -1073741515 (0xc0000135). The program '[23748] My1stSDL.exe' has exited with code -1073741515 (0xc0000135) 'A dependent dll was not found'.

最佳答案

两个简单的拼写错误。

SDL_SetRendererDrawColor -> SDL_SetRenderDrawColor。

SDL_renderPresent -> SDL_RenderPresent。

关于c++ - SDL C++ 错误 c3861,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49837695/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com