[Qt-interest] Splitting library?

AngelWarrior srikanth.bemineni at gmail.com
Wed Feb 10 20:55:23 CET 2010


See a library contains the implmentation code that is linked at the end of
the compilation during the linking stage.But before that you need to
specify , what is definition of the class and member functions via the
header files to the compiler .If you have assumption that it will be inside
the library then it is completely wrong. Try to show the compiler where
these header are using the
INCLUDEPATH directive.

On Wed, Feb 10, 2010 at 12:34 PM, Anatoly Burakov <
burakov.anatoly at googlemail.com> wrote:

> Hi all
>
> This question is not exactly related to QT, more of a general C++ question.
> Sorry for maybe a n00b-type problem but everyone has to start somewhere :-)
>
> I have made a small class library for use within a family of applications.
> I have separated it into several header/source files one per class, and one
> "root" header file which includes all these "child" header files. This whole
> library uses a separate namespace. On its own the library compiles OK, but
> whenever i try to include the "root" library header into the other project
> and try to use classes from the library - compiler can't find them (although
> IDE itself can - it lists all member functions when autocompleting code
> etc.) and gives an error of "undefined reference to
> Namespace::ClassName()::ClassName()". Am i missing something? By the way,
> the library worked fine when it was not separated into several files, so
> there must be something i don't understand about how headers work...
>
> The structure of the root header file is following:
> -------------------------
>
> #include <math.h>
>
> namespace Namespace {
>   // classes pre-declarations follow here e.g.
>   class childOne;
>   class childTwo;
>
>   // helper function header used throughout the class library e.g.
>   double hlpFunc(const double &value);
>
>   // helper enum used throughout the class library e.g.
>   enum hlpEnum {
>      varA = 0, varB = 5, varC = 10
>      };
> }
>
> // includes for child classes' headers e.g.
> #include "childone.h"
> #include "childtwo.h"
>
> -------------------------
>
> Best regards,
> Anatoly
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>


-- 
_/\_
With Regards
SB Angel Warrior
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100210/77cf8e55/attachment.html 


More information about the Qt-interest-old mailing list