Qt5.3发布windows Release版的几个注意事项
一个使用Qt5.3在MSVC2010下实现小的语音聊天室,
在开发环境中,将需要的DLL,如Qt5Core等放入.exe同目录后,放到干净的客户机后,可能需要注意的问题:
1、“This application failed to start because it could not find or load the Qt platform plugin "windows"”错误
需要qt的plugins/platforms文件夹。及libEGL.dll和libGLESv2.dll两个文件。
另外需要在main()函数中指明.exe目录为LibraryPath,代码如下:
QApplication a(argc, argv); QTextCodec *xcodec = QTextCodec::codecForLocale() ; QString exeDir = xcodec->toUnicode( QByteArray(argv[0]) ) ; QString BKE_CURRENT_DIR = QFileInfo( exeDir ).path() ; a.setLibraryPaths(QApplication::libraryPaths() << BKE_CURRENT_DIR); MainWindow w; w.show(); return a.exec();
2、QAudioDeviceInfo::availableDevices(QAudio::AudioInput)函数返回的声音输入设备为空
还是Qt plugins的问题,添加Qt\Qt5.3.2\5.3\msvc2010_opengl\plugins目录下的audio文件夹就可以了。
浙公网安备 33010602011771号