I have a subdirs project which wraps a couple libraries and a main application. When I change something in one of the libraries the main application does not relink with them.. does anyone have a trick for getting an application to relink with its statically linked libs automatically when using QtCreator?
Asked
Active
Viewed 5,468 times
1 Answers
31
There is a workaround for this and also an interesting discussion on the subject (qmake seems to be the problem here) on the Qt Creator mailing list.
The workaround is to add a PRE_TARGETDEPS
command to your main applications .pro file, e.g.:
PRE_TARGETDEPS += /path/to/your/lib.a
This forces the relink.

Rob
- 76,700
- 56
- 158
- 197
-
Thanks a ton, had found some discussions on the mailing list but had not stumbled across the workaround. – Dan O Sep 28 '09 at 19:29
-
5And the discussion is at... ?:) – mlvljr Aug 24 '12 at 19:06
-
This is obviously not portable to Windows though. – David Faure Jun 01 '17 at 16:12
-
This is portable on windows, you just need to specify a path and name of the lib. – TheDancinZerg Sep 30 '20 at 23:49