gpt4 book ai didi

c++ - 为什么Visual Studio试图从Team Fortress 2加载SDL2?

转载 作者:行者123 更新时间:2023-12-02 09:59:25 25 4
gpt4 key购买 nike

我尝试学习SDL2和C++,并遵循this tutorial进行所有设置,我复制了代码并下载了必要的文件并将其移动,但是,当我尝试运行代码时,这就是输出中显示的内容

'1stSDLWindow.exe' (Win32): Loaded 'C:\Users\Alec\source\repos\1stSDLWindow\x64\Debug\1stSDLWindow.exe'. Symbols loaded.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'.
'1stSDLWindow.exe' (Win32): Loaded 'C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin\SDL2.dll'.
'1stSDLWindow.exe' (Win32): Unloaded 'C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin\SDL2.dll'
The thread 0x7e8 has exited with code -1073741701 (0xc000007b).
The thread 0x32c8 has exited with code -1073741701 (0xc000007b).
The program '[6436] 1stSDLWindow.exe' has exited with code -1073741701 (0xc000007b).
没有屏幕显示绿色,如代码所示,并且 this弹出错误
这是代码
#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_SetRenderDrawColor(renderer, 0, 255, 0, 255);

SDL_RenderClear(renderer);

SDL_RenderPresent(renderer);

SDL_Delay(3000);
return 0;
}
为什么要尝试从我的TF2目录加载SDL2.dll?这是问题所在吗?如何从实际下载的文件夹加载.dll?

最佳答案

TF2的目录位于环境变量中,而这正是它试图从中加载的目录。我从PATH中删除了这些目录,并将SDL2.dll文件移到了为我的程序构建exe的位置

关于c++ - 为什么Visual Studio试图从Team Fortress 2加载SDL2?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63387008/

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