Search code examples
qtlinkerqmake

How to prevent Qt from linking


I have a bigger project including code in different languages. One part of it is written in C++/QML. The final linkage is performed via DMD. I need qmake to generate only object files without linking. Currently qmake tries to link a library, what fails with undefined reference.

Is there a way to make qmake generate only object files without linking?


Solution

  • Simply change the project type to the lib template, and add CONFIG += staticlib. The static library is simply a single file archive of all your objects. DMD can then link it to the final executable.