开发者

QT : Cannot find moc file

I'm trying to create a test application in QT to test another QT application's UI using qtlib. I learned that you also need to use QTEST_MAIN() macro which expands to a simple main() method that runs all the test functions.

QTEST_MAIN(TestAppUI)
#include "testapp.moc"

I'm compiling it using "make" and somewhere in my CMakeLists.txt I have

SET(TEST_APP_SRCS
ui/menu/testapp.cpp
)

SET(TEST_A开发者_如何学GoPP_SRCS_MOC_SRCS
ui/menu/testapp.hpp
)

QT4_WRAP_CPP(TEST_APP_SRCS ${TEST_APP_SRCS_MOC_SRCS})

My problem is, during compilation I'm getting this error.

error: testapp.moc: No such file or directory

I don't know what's wrong... Any ideas?


I just figured what's wrong. I needed to add ${QT_LIBRARIES} ${QT_QTTEST_LIBRARY} in TARGET_LINK_LIBRARIES ... :) and remove #include "testapp.moc"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜