首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

mfc中程序可以执行,但是exe文件不能执行,该如何处理

2013-12-20 
mfc中程序可以执行,但是exe文件不能执行如题,程序打开后,单击运行,程序可以正确运行。但是在release或者deb

mfc中程序可以执行,但是exe文件不能执行
如题,程序打开后,单击运行,程序可以正确运行。但是在release或者debug下面点击生成的.exe文件时候,却出现错误:无法启动此程序,因为计算机中丢失**.dll。尝试重新安装该程序以解决此问题。**.dll是我自己生成的动态链接库,这个已经编译好,并且可以放在程序中可以正常运行。
请大家看看什么问题。原来的程序是vs2008的,后来我移植到了vs2010上面了,一些动态库不能用,我又重新生成的动态库。
谢谢啦~

[解决办法]
楼主实际遇到的问题是信息不畅
如果楼主知道一般的处理方法就是“将exe和dll放到同一个目录下”,那楼主就不会有疑问了
当然,也可以放在system32文件夹下,也可以放在某个特定文件夹下然后将该文件夹路径加入path环境变量内

静态编译的意思是不使用dll而使用lib
mfc使用静态库,跟你自己的dll一点关系都没有
[解决办法]

引用:
没有,生成之后,直接用的,需要注册吗?
Quote: 引用:

dll注册过了么?


应该要的。试试注册之后再执行EXE看看,或者试试把你的dll拷贝到system32路径下再执行看看
[解决办法]
注意, 可能调试运行与直接运行环境是不同的, 你最好是测试到release目录中直接运行你的程序, 如是要提示缺少库, 就把那个dll复制到release目录中. 再运行.

不般的dll是不需要注册的, 如果只是提供接口, 没听说过要注册.
[解决办法]
Windows searches for the DLL file in the following sequence: 

The directory from which the application loaded. 
The current directory. 
Windows 95 and Windows 98: The Windows system directory. Use theGetSystemDirectory function to get the path of this directory.
Windows NT: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32. 

Windows NT: The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM. 
The Windows directory. Use theGetWindowsDirectory function to get the path of this directory. 
The directories that are listed in the PATH environment variable. 

热点排行