问题
I'm finding a strange issue with Qt Creator 3.0.1 that is not refreshing the current state of the configuration before compiling and linking. To explain myself better, say my code isn't initially compiling because it's missing a library (e.g. opencv_core248d). If I add it in the .pro file like this:
LIBS += -L$$(OPENCV_DIR)/build/x86/vc11/lib -lopencv_core248d
the project won't compile and link until I go and manually delete the makefiles generated by qmake (Clean All doesn't work!). After this it will compile, but if I comment the line above it will continue compiling until I manually delete the makefiles again!.
I'm using msvc2012 x86 Qt 5.2.1 and the Qt creator that comes with it. OS is Win7 SP1 x64. Is this a bug on Qt Creator or am I missing something?
回答1:
Unfortunately, this is a known issue that sometimes QtCreator does not rerun qmake and you need to rerun qmake explicitly. There is an option in QtCreator to run qmake. There is no need to delete anything in the background, however.
This is a long standing issue still not fixed and it was one of the first reported issues:
Creator should know when to rerun qmake
来源:https://stackoverflow.com/questions/23026868/qt-not-refreshing-makefiles-after-changes-in-the-pro-file