简体   繁体   English

由于您的计算机上缺少freeglut.dll,因此无法启动该程序

[英]This program can't start because freeglut.dll is missing from your computer

I recently started using freeglut, and it worked fine when I built it and ran it (I'm using Code::Blocks, by the way), but when I went to the debugged exe, it says: "This program can't start because freeglut.dll is missing from your computer. Try reinstalling the program to fix this problem." 我最近开始使用freeglut,在我构建并运行它时,它运行良好(顺便说一下,我使用的是Code :: Blocks),但是当我进入调试的exe时,它说:“该程序不能因为您的计算机上缺少freeglut.dll,请重新启动。请尝试重新安装该程序以解决此问题。” I read that freeglut.dll should be in the same folder, and it worked, but is there any way to include it with the exe so it could be portable, I'm pretty novice at C++, so thanks for any help :) 我读到freeglut.dll应该在同一个文件夹中,并且可以工作,但是有什么办法可以将它包含在exe中,以便它可以移植,对于C ++来说我还是个新手,因此感谢您的帮助:)

您将需要配置链接器以静态链接库。

Have to give credit to @πάντα ῥεῖ, for suggesting this first, but I felt that it should be an answer too. 必须首先赞扬@πάνταῥεῖ,因为它首先提出了建议,但我认为这也应该是一个答案。 If you don't want to statically link the libraries, you can just add the path to the freeglut.dll file to your path. 如果您不想静态链接库,则只需将freeglut.dll文件的路径添加到您的路径。 This is done (one a session basis) by executing set path=%path%;[PATH_TO_FREEGLUT_DOT_DLL] in the command prompt. 通过在命令提示符下执行set path=%path%;[PATH_TO_FREEGLUT_DOT_DLL] ,可以完成此操作(基于会话)。

如果您运行的是64位计算机,请尝试将freeglut.dll放入c:\\ windows \\ syswow64文件夹,由于某种原因,它在我的system32文件夹中不起作用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM