GLFW需要30秒才能初始化 [英] GLFW takes 30 seconds to initialize

查看:138
本文介绍了GLFW需要30秒才能初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

向下投票

最爱

我一直在努力进入C ++和OpenGL开发等等,但我遇到了一个我似乎无法用以下代码弄清楚的问题:



down vote
favorite
I've been trying to get into C++ and OpenGL development and such, but I've run into an issue I can't seem to figure out with the following code:

int main() {
std::cout << "Attempting to load" << std::endl;

if (!glfwInit()) {
    std::cout << "Error loading GLFW" << std::endl;
    return 0;
}
else {
    std::cout << "Loaded GLFW" << std::endl;
}

using namespace kreezyEngine;
using namespace graphics;

Window window("Kreezy Engine", 800, 600);

while (!window.isClosed()) {
    window.update();
}

return 0;
}





现在,代码工作正常,只是我注意到甚至创建窗口需要30秒。经过一些调试后,我注意到正在打印正在加载,但是在控制台中打印已加载的GLFW大约需要30秒。我觉得初始化glfw真的很慢,因为我正在观看的教程不会超过一秒。



任何帮助?



谢谢:)



我尝试过:



我已经尝试更新我的驱动程序了。

我试过禁用我的Windows防御者(如果它搜索dll病毒或其他什么)

我'我试过重新启动我的电脑:P



Now, the code works fine, it's just that I noticed it took 30 seconds to even create the window. After some debugging, I noticed that "Attempting to load" is being printed, but it takes around 30 seconds for "Loaded GLFW" to be printed in the console. I feel like thats really slow to initialize glfw, as the tutorial im watching takes no more than a second.

Any help?

Thanks :)

What I have tried:

I've tried updating my drivers.
I've tried disabling my windows defender (in case its searching the dlls for viruses or whatever)
I've tried restarting my pc :P

推荐答案

你还没有正确安装GLFW。请阅读安装指南进行修复。



提示:

a)检查你的链接是否有延迟dll加载的标志。

b)从互联网上断开电脑连接看看是否有一些魔法装载没有完成。
You havent the GLFW properly installed. Read this installation guide to fix it.

Tips:
a) Check that your havent linked with some flags for "delayed dll loading".
b) Disconnect the pc from the internet to see whether some "magic loading" isnt done.


这篇关于GLFW需要30秒才能初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆