Currently the linker in one project has problems linking to object files generated by source files in another project. Is there some way to manually add those object files to Qt?
Asked
Active
Viewed 7,797 times
4
-
Why don't you link those object files as library? – Frank Osterfeld Jan 10 '11 at 10:21
-
@Frank how do I make a library, and how do I link to them as that? – wrongusername Jan 10 '11 at 18:12
2 Answers
8
Building on ismail's answer, if you have a directory with many object files, you don't have to include each one separately. You can just write:
LIBS += "../path-to-objs/*.obj"
You can also specify different object files to link against for debug and release builds with:
Release:LIBS += "../path-to-objs/Release/*.obj"
Debug:LIBS += "../path-to-objs/Debug/*.obj"
I include this because my MSVC linker complains when the specified object files don't match the build type (release/debug).

Carlton
- 4,217
- 2
- 24
- 40