[Qgis-developer] I am trying to add a class to core

Benedict Holland benedict.m.holland at gmail.com
Sun May 19 21:05:12 PDT 2013


So I am trying to create data frames with a QgsMapCanvas. I assumed this
went under core but it might touch too much to not go under app for the
time being or perhaps even gui. I only asked after about an hour of trying
to figure out a linker error before sticking it under app. I think I am
going to get a basic set of functions working and we can figure out where
QgsDataFrame actually goes.

Thanks for the help.
~Ben


On Sun, May 19, 2013 at 11:48 PM, Nathan Woodrow <madmanwoo at gmail.com>wrote:

> Hey Benedict,
>
> The core library is not meant to just be non-gui bits, hence why we have
> core and gui.  As QgsMapCanvas is a class in gui you can't use it in core.
>
> What did you have in mind we might be able to work out a way to fit it in.
>
> Regards,
> Nathan
>
>
> On Mon, May 20, 2013 at 1:32 PM, Benedict Holland <
> benedict.m.holland at gmail.com> wrote:
>
>> Hi All,
>>
>> I am trying to create a brand new class for the core section of the code
>> but I am getting linker errors. I am trying to include gui/qgsmapcanvas.h
>> and then create a QgsMapCanvas object but I am getting an error which says
>> that:
>>
>> undefined reference to `QgsMapCanvas::QgsMapCanvas(QWidget*, char const*)'
>>
>>
>> I am guessing this is because I am trying to use an object found in the
>> gui library but somehow isn't getting linked correctly to the core library.
>> I added the core class I created to the CMakeList.txt and it seems to build
>> so I assume I did that correctly. Adding ../gui in the INCLUDE_DIRECTORIES
>> section didn't seem to help but at least I can now refer to the header as
>> just "qgsmapcanvas.h" instead of "../gui/qgsmapcanvas.h"
>>
>>
>> Basically, I can't figure out the magic that is required to link a class
>> from the gui library to the core library. What do I do?
>>
>>
>> Thanks,
>>
>> ~Ben
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130520/f2736ae7/attachment.html>


More information about the Qgis-developer mailing list