1

I have a windows screensaver that I want to recompile using the QT libraries, so that I can make available for more platforms. I am facing problems with the deployment on Vista and XP.

I compile my screensaver statically with MT, and run the dependency checker. The results are:

MyScreensaver.SCR needs several DLLS, QTCORE4.DLL but no MSVCx80.DLLs. So far this is fine.

My problem is that QTCORE4.DLL in its turn, does need MSVCP80.DLL and MSVCR80.DLL As a result my application does not run on Vista systems.

Can I build QTCORE4.DLL to be statically linked the the microsoft libraries (maybe Libcmt.lib ?) so that I do not have any dependencies in the MS CRT DLLs?

Limitations:

After trying for solutions in various directions, it seems the most feasible one is to use the QTCore4.dll and QTGui4.dll, but having them linked statically to MSVCRT. In this way, neither my program, nor the QT DLLs will have dependencies on MSVCRT dlls.

Is there a solution to this? ( I am new to QT programming )

Thank you, Michael

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Mike
  • 436
  • 5
  • 9
  • Update: I have built QT statically, I have included in the linker the QTcore.lib and build my applitation also statically with /MT. I see now that the screensaver depends on MSVCR80.DLL, most probably because the static build of QT (QTcore.lib) also depends on it. MSVCR80.DLL is a barrier to me because as I said above I cannot deploy on XP, and vista. So, the question now is: Is there any way to build a QT application without dependency on MSVCR80.DLL ? Thanks for any help Michael – Mike Jul 08 '09 at 18:11

2 Answers2

1

I think they are concerted that parts of your application will be compiled with /MD(d) and parts with /MT(d), but if you control everything (including 3rd party libraries) then its pretty safe to use /MT(d).

Shay Erlichmen
  • 31,691
  • 7
  • 68
  • 87
  • thank you Shay, I will retry making a static linking. The previous time I attempted a static linking, the application was causing an error when exiting. The error was after the end of my code, and I thought that this is a problem because of the static linking. Therefore, I will wait a bit, to see if there is an answer in statically linking the QT DLLs with the MS CRT libraries. If there is a way to do this, I would prefer to go that way. – Mike Jun 30 '09 at 10:04
1

You have two options:

  • Those dependencies are part of Microsoft Visual C++ Runtime Library, you can deploy that library in your installshield and user silently installs it, MSVCRT library not included in Windows by default, you must deploy runtime library in your installshield and copy Qt*.dll DLLs in your application directory.

  • Use Static Linking of Runtime and Qt main dependencies, with this option you have one executable file, but to static compile of Qt you must have Qt commercial License for commercial use.

Reza Ebrahimi
  • 3,623
  • 2
  • 27
  • 41