Qt test linking error
-
Hey there, I've created a subdirs project with gui and test projects and I've added the SOURCES and HEADERS in test .pro file with INCLUDEPATH. When I'm trying to add 'homeScreen' class to test project, I'm getting linking errors that ui memebers like labels are not found.
../../clockApp/clock-alarmApp/homescreen.cpp: In member function 'void homeNameSpace::homeScreen::timeUpdateSlot()': ../../clockApp/clock-alarmApp/homescreen.cpp:46:9: error: 'class Ui::homeScreen' has no member named 'mainTimeLabel'the homeNameSpace includes the homeScreen class definition in the homeScreen.h file
The test pro file:
QT += gui core widgets CONFIG += qt warn_on depend_includepath testcase TEMPLATE = app INCLUDEPATH += ../clock-alarmApp SOURCES += tst_loadingtest.cpp \ ../clock-alarmApp/homescreen.cpp \ ../clock-alarmApp/splashscreen.cpp HEADERS += \ ../clock-alarmApp/homescreen.h \ ../clock-alarmApp/splashscreen.h RESOURCES += \ ../clock-alarmApp/resources.qrc -
Hey there, I've created a subdirs project with gui and test projects and I've added the SOURCES and HEADERS in test .pro file with INCLUDEPATH. When I'm trying to add 'homeScreen' class to test project, I'm getting linking errors that ui memebers like labels are not found.
../../clockApp/clock-alarmApp/homescreen.cpp: In member function 'void homeNameSpace::homeScreen::timeUpdateSlot()': ../../clockApp/clock-alarmApp/homescreen.cpp:46:9: error: 'class Ui::homeScreen' has no member named 'mainTimeLabel'the homeNameSpace includes the homeScreen class definition in the homeScreen.h file
The test pro file:
QT += gui core widgets CONFIG += qt warn_on depend_includepath testcase TEMPLATE = app INCLUDEPATH += ../clock-alarmApp SOURCES += tst_loadingtest.cpp \ ../clock-alarmApp/homescreen.cpp \ ../clock-alarmApp/splashscreen.cpp HEADERS += \ ../clock-alarmApp/homescreen.h \ ../clock-alarmApp/splashscreen.h RESOURCES += \ ../clock-alarmApp/resources.qrcYou need to add
FORMSand point to your .ui file, too. -
F febinzcs has marked this topic as solved on