gpt4 book ai didi

c++ - 具有 SDL2 问题的 Visual Studio 代码

转载 作者:太空宇宙 更新时间:2023-11-04 12:50:08 25 4
gpt4 key购买 nike

我正在尝试让 SDL2 与 visual studio 代码一起工作,但它似乎找不到头文件。

这是我在终端中遇到的错误。

Executing task: C:/MinGW/bin/g++ C:\Users\codyc\Desktop\SDL\SDL2-2.0.8\i686-w64-mingw32\bin C:\Users\codyc\Desktop\SDL\SDL2-2.0.8\i686-w64-mingw32\include\SDL2 C:\Users\codyc\Desktop\SDL\SDL2-2.0.8\i686-w64-mingw32\lib <
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find C:\Users\codyc\Desktop\SDL\SDL2-2.0.8\i686-w64-mingw32\bin: Permission denied
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find C:\Users\codyc\Desktop\SDL\SDL2-2.0.8\i686-w64-mingw32\include\SDL2: Permission denied
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find C:\Users\codyc\Desktop\SDL\SDL2-2.0.8\i686-w64-mingw32\lib: Permission denied
collect2.exe: error: ld returned 1 exit status
The terminal process terminated with exit code: 1

最佳答案

为 Windows 开发安装像 SDL2 这样的开源库并使用像 mingw32 这样的工具进行交叉编译对于初学者来说可能是相当具有挑战性的。

建议从GitHub下载vcpkg,它是visual studio C++的开源打包器。安装后,您可以通过 Powershell 命令行导入许多此类项目。在您的情况下,它看起来像这样:.\vcpjg install sdl2:x64-windows-static

关于c++ - 具有 SDL2 问题的 Visual Studio 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49459467/

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