I have a Symbian project in Qt/QWidget and I want to use most of its code into another project, just have a different main.cpp and different QMainWindows.

I created a Subdirs Project (SubProject) and then another mobile project (I named it also SubProject) and in main.cpp of SubProject I include some files from the MainProject.

The problem is that I get "undefined reference" error on build for all classes from MainProject I'm trying to reference. I tried also adding them to SubProject.pro, but it's the same error. What am I doing wrong and how to correctly create a subproject that can use the files from main project?

Code:
make.exe: Entering directory `C:/Develop/QtProjects/MainProject/SubProject'
sbs -c arm.v5.udeb.gcce4_4_1
 mifconv    : BITMAP  	[arm.v5.udeb.gcce4_4_1]
 target     : epoc32\release\armv5\udeb\SubProject.exe  	[arm.v5.udeb.gcce4_4_1]
   c:/qtsdk/symbian/tools/gcce4/bin/../lib/gcc/arm-none-symbianelf/4.4.1/../../../../arm-none-symbianelf/bin/ld.exe: warning: C:/QtSDK/Symbian/SDKs/SymbianSR1Qt474/epoc32/release/armv5/udeb/usrt3_1.lib(ucppinit.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
   C:/QtSDK/Symbian/SDKs/SymbianSR1Qt474/epoc32/build/subproject/c_49a1196a6e3af7fc/Subproject_exe/armv5/udeb/main.o: In function `main':
   C:/Develop/QtProjects/MainProject/SubProject/SubProject/src/main.cpp:218: undefined reference to `MyClass::getInstance()'