gpt4 book ai didi

c++ - 如何修复 Visual Studio 2015 Preview 上 Unresolved SDL 2.0.3 外部问题?

转载 作者:可可西里 更新时间:2023-11-01 15:22:59 25 4
gpt4 key购买 nike

所以我收到以下错误:

1>SDL2main.lib(SDL_windows_main.obj) : error LNK2019: unresolved external symbol __imp__fprintf referenced in function _ShowError
1>SDL2main.lib(SDL_windows_main.obj) : error LNK2019: unresolved external symbol __imp____iob_func referenced in function _ShowError

我的代码很简单:

#include <iostream>
#include "SDL2\SDL.h"

int main(int argc, char* argv[])
{
std::cout << "Hello World!" << std::endl;

return 0;
}

我已经正确链接了这些库,这在 vs2012 中运行良好,但由于某些原因无法在 vs2015 中编译。

最佳答案

我在使用 SDL 1.2 时遇到了同样的问题 - 对我有用的解决方案是下载 SDL 源代码并使用 VS 2015 构建库。当我链接到新的(VS2015)构建的库时问题得到解决 - 也许有人应该对 SDL 2 尝试同样的方法(从源代码重建库)?

关于c++ - 如何修复 Visual Studio 2015 Preview 上 Unresolved SDL 2.0.3 外部问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28247992/

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