После долгого перерыва в программировании вроде как обычно создаю класс и получаю такие ошибки:
debug/mainwindow.o: In function `Test':
F:\Projects\TEST-build-desktop/../TEST//test.h:10: multiple definition of `Test::Test()'
debug/main.o:F:\Projects\TEST-build-desktop/../TEST//test.h:10: first defined here
debug/mainwindow.o: In function `Test':
F:\Projects\TEST-build-desktop/../TEST//test.h:10: multiple definition of `Test::Test()'
debug/main.o:F:\Projects\TEST-build-desktop/../TEST//test.h:10: first defined here
debug/moc_mainwindow.o: In function `Test':
F:\Projects\TEST-build-desktop/debug//../../TEST/test.h:10: multiple definition of `Test::Test()'
debug/main.o:F:\Projects\TEST-build-desktop/../TEST//test.h:10: first defined here
debug/moc_mainwindow.o: In function `Test':
F:\Projects\TEST-build-desktop/debug//../../TEST/test.h:10: multiple definition of `Test::Test()'
debug/main.o:F:\Projects\TEST-build-desktop/../TEST//test.h:10: first defined here
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\TEST.exe] Error 1
mingw32-make: *** [debug] Error 2
test.h:
#ifndef TEST_H
#define TEST_H
class Test
{
public:
Test();
};
Test::Test()
{
}
#endif // TEST_H
В mainwindow.h добавлены только две строки:
#include "test.h"
Test test;
Остальное стандартный шаблон.
В вложении сам проект.