1

I'm writing a Qt application.

My Qt license is LGPL so I'm trying to figure out whether the application is linking statically to Qt libraries.

Is there a way to tell by looking at the .pro file or Makefile generated by qmake?

I'm using Qt 4.6.3 shipped with TI DVSDK 4.0.0.3

user3528438
  • 2,737
  • 2
  • 23
  • 42

1 Answers1

2

No, it's not possible by looking at the .pro file, since the .pro file remains the same no matter how the Qt build is compiled. It's your .pro file, after all, not Qt's.

You could look at the target link command in the Makefile, and see whether the target is linked with .a files or .so files. Even that is an unnecessary diversion, though.

Simply use ldd to show whether your executable is dynamically linked with Qt.

You could also look at the configuration options of the Qt kit that you're using.

Finally, LGPL is not incompatible with static linking. All that LGPL requires is that those you distribute the code to can re-link your closed source code with the LGPL library. For dynamic linking, they simply need to re-build the exact same configuration of Qt that you provided them, and swap the .so/.dll files. For static linking, they need to re-link your closed source object files with the copy of Qt that they themselves built from sources you provided. The simplest way to providing such object files is to have your project linked into a static library. That library can be then linked with Qt static library to produce the final executable. You'd need to provide your project's closed-source part as a static library, on request. IANAL!

Community
  • 1
  • 1
Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • 1
    I looked at the link you provided. Unfortunately `ldd` is not available on my host or target. But with `objdump -p` I see `NEEDED libQtGuiE.so.4` so I believe it's using dynamic linking. I'll do similar checks on other LGPL libraries I'm using. I'm indeed considering the obj code as an option, too. IANALE. – user3528438 Jun 23 '15 at 22:47