Home > Mobile >  Qt program did not load the DLL function is not normal in the plugins
Qt program did not load the DLL function is not normal in the plugins

Time:09-21

wrote A qt application (program A) , using the recording function inside, but I don't know why, is associated with the recording of the DLL in the program is running without load (undetectable recording equipment), cause the program is not normal (undetectable recording equipment), but the entire program at run time is no exception, also did not collapse, qt windeployqt program used for packaging, relevant DLL in the program run directory,


but if you write a simple test program (B) , this program just detection, and print the default recording equipment name, in the process of running to loader directory under the audio DLL (qtaudio_wasapi. DLL and qtaudio_windows. DLL), the program can be run normally at this time,

now the question is: why can't a program normal load corresponding DLL, led to the program does not run normally, but not collapse; And another program can run normally, function also is normal?
In the use of windeployqt after deployment of the application, you can see copy of DLL, Qt5Core. DLL is modified,

But if the installation directory Qt5Core. DLL copied directly, and then run the program. A, can be normal operation of the program, the corresponding DLL will be loaded, but part of the DLL is loaded installation directory DLL, rather than the current program directory DLL, it is strange that


But if will copy the two programs on a computer is not install qt (have used windeployqt deployment, also complete corresponding DLL), the program can run, but cannot be detected in normal recording equipment, (audio folder under the two DLL has not been loaded: qtaudio_wasapi. DLL and qtaudio_windows. DLL)

CodePudding user response:

The normal procedure,
The core is at the beginning of the main function of this sentence: QCoreApplication: : addLibraryPath ("./");
  •  Tags:  
  • Qt
  • Related