由于找不到libgcc_s_dw2-1.dll,无法继续执行代码。重新安装程序可能会解决此问题

使用QT Creator编写完程序后,在QT Creator 中构建运行一下,非常丝滑,exe文件直接就运行起来了,欣喜若狂地把软件发给别人玩玩,好,出问题了,在别人的电脑上运行不起来,开始报错,这时候才发现,自己文件夹中的exe也报错运行不起来,只有在QT Creator中能运行,这确实太耽误事了。

报错:
在这里插入图片描述

于是尝试解决一下,网上各种搜,添加了一个.dll,就报缺少另一个.dll,然后有找到另一个添加进去,还是缺少,于是添加了一堆,结果无济于事。心情极度复杂…
我想唯有把缺少的文件全部补充完,大抵程序才能跑起来罢。

后来尝试修改了环境变量,例如:
在高级系统设置-环境变量-PATH添加D:\AWQW\RFID\QT\5.9.9\mingw53_32\bin这个目录。
ps:需要把这个放到path中的首位,不然也可能会出错。

这种方法确实解决了问题,在自己电脑上可以运行起来了,但是在别人的电脑上依旧运行不了,终究不是万全之策呀!

解决方法:

1.在QT Creator使用release构建运行一下代码,不要使用debug,然后release文件夹中找到生成的exe文件,把这个文件复制一下,粘贴到一个新的文件夹中。
例如这样:

在这里插入图片描述
2.找到开始里面的QT文件夹,打开Qt 5.9.9(MinGW 5.3.0 32-bit)文件

在这里插入图片描述
3.把路径切换到你刚刚存放exe的那个文件夹下,这个文件夹中只有一个你刚刚放进去的exe文件

在这里插入图片描述
4.使用windeployqt 程序名这个命令,自动补充程序运行所依赖的文件,从而把你这个程序运行所需要的的环境给配置好。
例如:windeployqt jishiqi1.exe

在这里插入图片描述
5.现在程序运行所依赖的文件就自动添加到这个存放exe文件的文件夹中了。此时,exe文件就可以成功运行了!!!

在这里插入图片描述
6.当然如果你的程序里面包含图片、视频等一些外部资源,那么就需要你手动复制到这个文件夹中去了,否则,运行的程序加载不出来图片等外部资源哦!
例如:

在这里插入图片描述
好了,到此这个exe程序就可以成功运行起来了,把这个文件夹压包发给别人,也可以正常运行。现在无论是在自己的电脑上,还是再别人的电脑上,终于可以让小伙伴愉快的玩耍啦。

  • 25
    点赞
  • 97
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 13
    评论
Step 1 Open the zip-file you downloaded from DLL-files.com . Extract the DLL-file to a location on your computer. If you are unsure about how to extract your zip-file we recommend using File Viewer Plus 2. With it you can open your zip-file as well as over 300 other file formats (like video, music, images, pdf etc.) It’s a handy tool to keep around. After extracting your zip-file, place the extracted DLL-file in the directory of the program that is requesting the file. Make sure to use a 32bit DLL-file for a 32bit program, and a 64bit DLL-file for a 64bit program. Failure to do so will likely result in a 0xc000007b error. Step 2 If that does not help your problem, place the file to your system directory. By default, this is C:\Windows\System (Windows 95/98/Me), C:\WINNT\System32 (Windows NT/2000), or C:\Windows\System32 (Windows XP, Vista, 7, 8, 8.1, 10). On a 64bit version of Windows, the default folder for 32bit DLL-files is C:\Windows\System32\ , and for 64bit dll-files C:\Windows\SysWOW64\ . Make sure to overwrite any existing files (but make a backup copy of the original file). Reboot your computer. Step 3 If the problem still occurs, try the following to register the DLL-file: For 32bit DLL-files on a 32bit Windows, and for 64bit DLL-files on a 64bit Windows: Open an elevated command prompt. To do this, click Start, click All Programs, click Accessories, right-click "Command Prompt", and then click Run as administrator. In Windows 8/10, go to the Start screen. Start typing cmd and Windows will find "Command Prompt". Right click "Command Prompt" and choose "Run as administrator". If you are prompted for an administrator password or for a confirmation, type the password, or click Allow. Type regsvr32 "filename".dll and press Enter. Registering 32bit DLL-files on a 64bit Windows: Open an elevated command prompt, as instructed above. In the command prompt, start by typing following and press enter: cd c:\windows\syswow64\ th

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

霍志杰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值