How to add object files to a project in Qt

倖福魔咒の 提交于 2019-11-29 11:35:55

Try using the LIBS directive in your *.pro file;

LIBS += /path/to/foo.o

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).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!