求助 QLibrary

daiheitan 2010-05-01 02:33:37
灵异了,要是能google到解决方法我也不会在这里发帖的= =
用QT opensource 4.6.2,MS2008静态编译的版本。
用Qlibrary加载一个DLL时,得到errormessage:Connot load XXXXX.dll:找不到指定的模块。
加载.lib也一样。求解释。。
...全文
526 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
hsaxh 2010-05-03
  • 打赏
  • 举报
回复
求个QQ盗号工具
daiheitan 2010-05-03
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 gemfield 的回复:]

那么sdk里面的dll是用什么编译的???
[/Quote]
SDK一开始我有两份,一个是mingw编译的,另一个是VC2008静态编译的。VC的那一份是官方下载的VS2008SDK包,但是看来里面的DLL并不是VS2008编译的。总之不能整成加载。自己编译了VC2008的动态链接版本编译DLL后一切正常。
gemfield 2010-05-02
  • 打赏
  • 举报
回复
那么sdk里面的dll是用什么编译的???
xiao4623581 2010-05-02
  • 打赏
  • 举报
回复
恩,学习了
daiheitan 2010-05-01
  • 打赏
  • 举报
回复
但是errorString是说connot load phonon.dll,要是说connot load phonon.DLL.DLL,我还能理解。
为了确保不是DLL的问题,我都是用一些QT的DLL做实验的
Cannot load library XXX.DLL
如果去掉扩展名,就会说,Cannot load library XXX.找不到指定的模块。
dext 2010-05-01
  • 打赏
  • 举报
回复

[Quote=引用 3 楼 daiheitan 的回复:]

QLibrary libQuazip("phonon.dll");
if(!libQuazip.load())qDebug()<<libQuazip.errorString()<<endl;

这样就会说,找不到指定的模块。但是phonon.dll和程序都在release文件夹中。。。
但是换到动态编译的版本就没问题= =
[/Quote]

QLibrary libQuazip("phonon");
知道你也会加 .dll 所以才让你贴代码。

Qt Doc 这样解释

We recommend omitting the file's suffix in fileName, since QLibrary will automatically look for the file with the appropriate suffix in accordance with the platform, e.g. ".so" on Unix, ".dylib" on Mac OS X, and ".dll" on Windows. (See fileName.)

我们推荐 省略 文件的固定前后缀。因为 QLibrary 会根据情况 自己在不同平台上做处理
在 Unix 上是 .so 在 Mac 上是 .dylib 在Windows 上是 .dll
daiheitan 2010-05-01
  • 打赏
  • 举报
回复
在线求解释。。。
daiheitan 2010-05-01
  • 打赏
  • 举报
回复
QLibrary libQuazip("phonon.dll");
if(!libQuazip.load())qDebug()<<libQuazip.errorString()<<endl;

这样就会说,找不到指定的模块。但是phonon.dll和程序都在release文件夹中。。。
但是换到动态编译的版本就没问题= =
daiheitan 2010-05-01
  • 打赏
  • 举报
回复
我知道了,QLibrary加载DLL的时候,当前的编译环境必须和DLL的环境一致。如果是在MS VC下写程序,那么加载的DLL也必须在MS VC下编译才行。今天拿VC编译了一个动态编译的QT重新编译了DLL之后就OK了,之前测试的DLL都是mingw的。
麻烦大家了。
MicroSky2813 2010-05-01
  • 打赏
  • 举报
回复
地址问题?
dext 2010-05-01
  • 打赏
  • 举报
回复
贴代码吧。我帮你看看 使用 QLibrary 的时候 要注意文件名。
daiheitan 2010-05-01
  • 打赏
  • 举报
回复
我发现Cannot load library:找不到指定模块。貌似并不是errorstring中的一条(看了看源代码),难道是静态编译QT的时候出问题了?

16,216

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧