Mike
Mike

Reputation: 496

How to build QTcore4.dll without dependency to MSVCx80.dll?

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

Upvotes: 1

Views: 3214

Answers (2)

Reza Ebrahimi
Reza Ebrahimi

Reputation: 3689

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.

Upvotes: 1

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

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).

Upvotes: 1

Related Questions