The error you are getting is a linker error not a compiler error (undefined 
reference).

It looks like you will need to link against the other lib you are creating or 
do as Adam says and make an app project instead of a subdirs one and include 
all the sources in it.

Alan

On Aug 16, 2010, at 7:31 AM, ext Coda Highland wrote:

> First off, don't use a subdirs project for that. Just use a normal
> "app" project and use relative paths in the .pro file. If you want to
> organize the .pro file you can use include() with some .pri files --
> Creator knows how to sort this out. (Note that .pri files consider
> paths relative to the main .pro file, not to itself.)
> 
> Second, "INCLUDEPATH += Frames" in the main .pro file (or possibly in
> frames.pri) so that "Frame1/Frame1.h" can be found inside of the
> "Frames" directory.
> 
> /s/ Adam
> 
> On Mon, Aug 16, 2010 at 8:51 AM, Jakov <dkym...@gmail.com> wrote:
>> Hello Group,
>> 
>> I have a question about organizing subdir/nested classes in Qt Creator. I
>> intend to use dozens classes (inherit from QFrame), to be promoted later. I
>> want to have each of them grouped in a separate folder (dir). Like this:
>> 
>> <PROJECT_ROOT>
>> ----- Frames
>> --------- - frames.pro
>> --------- - Frame1
>> ---------------- frame1.h
>> ---------------- frame1.cpp
>> ---------------- frame1.ui
>> ---------------- frame1.pri
>> -------- - Frame2
>> ---------------- frame2.h
>> ---------------- frame2.cpp
>> ---------------- frame2.ui
>> ---------------- frame2.pri
>> ----- ex1.pro
>> ----- ex1.h
>> ----- ex2.cpp
>> 
>> File frame?.pri indicates HEADERS, SOURCES, FORMS
>> File frames.pro simply includes those *.pri files.
>> File ex1.pro:
>> + TEMPLATE = app subdirs
>> + SUBDIRS     += Frames
>> 
>> That's it. The problem comes when I'm trying to use frame1, frame2 in the
>> main project (ex1). Although I specify INCLUDEPATH += Frames/Frame1 in the
>> ex1.pro, ex1 can "see" frame1.h, but it doesn't know about frame1.cpp, so an
>> error thrown: undefined reference to `TFrame1::TFrame1(QWidget*)'
>> 
>> I'll try to summary the problem: how to put individual classes in subdir
>> freely?
>> 
>> Please help me.
>> 
>> Thank you in advance!!!
>> 
>> Best regards,
>> 
>> Jakov
>> 
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator@trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>> 
>> 
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator


_______________________________________________
Qt-creator mailing list
Qt-creator@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to