[Interest] What is the right way of creating a static lib that has qml resources with cmake?

Thiago Macieira thiago.macieira at intel.com
Thu Jan 12 15:18:59 CET 2023

On Thursday, 12 January 2023 00:36:01 PST Ulf Hermann via Interest wrote:
> That's because linkers "optimize" the resources out if you don't.

Strictly speaking, this should read "linkers don't include stuff you don't 
need". If you don't need a particular .o from the static library, it won't be 
included in the output.

"Need" is defined as "provides a symbol that is undefined in the linker at this 

> We can't do much about this.

Yes, there is. There's -Wl,--whole-archive for the Unix linkers. This should 
solve the problem for everyone except MSVC users.

Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering

More information about the Interest mailing list