[Qgis-developer] problems building c++ qgis plugin and/or qgis

Tasos Varoudis null at archtech.gr
Fri Aug 17 01:43:49 PDT 2012


Any tips for which is the easiest platform to develop? Linux distro version or other? compiling QGIS from scratch on my mac and ubuntu 12.04 is a problem.

Best,
Tasos

PS: I have done the cmake(bug fix) trick but no-go.

On 16 Aug 2012, at 15:37, William Kyngesburye <woklist at kyngchaos.com> wrote:

> On Aug 16, 2012, at 8:57 AM, Tasos Varoudis wrote:
> 
>> 
>> On 16 Aug 2012, at 14:34, William Kyngesburye <woklist at kyngchaos.com> wrote:
>> 
>>> On Aug 16, 2012, at 7:23 AM, Tasos Varoudis wrote:
>>> 
>>>> 
>>> For OS X, if you want cmake to find your Homebrew libraries instead of the standard frameworks, you need to add to your cmake command:
>>> 
>>> -D CMAKE_FIND_FRAMEWORK=LAST
>>> 
>>> BUT, there is a bug in cmake currently that this setting is completely ignored.  You will have to either apply the patch mentioned in the bug report to your cmake source and recompile cmake, or install cmake from dev sources.
>>> 
>>> http://public.kitware.com/Bug/view.php?id=13261
>>> 
>>> Also, for building external plugins for QGIS on OS X, QGIS libs are frameworks, so you can't link your plugin with the -l flags, that's why you're getting linking errors.  But the QGIS frameworks bundled in the app aren't suitable for linking, so you need to tell cmake to install dev frameworks with:
>>> 
>>> -D QGIS_MACAPP_INSTALL_DEV=TRUE
>>> 
>>> These will install in /Library/Frameworks, so all you need to do for your plugin is link with:
>>> 
>>> -framework qgis_core -framework qgis_gui
>>> 
>>> You don't need '-L//Users/varoudis/Desktop/Projects/Quantum-GIS/lib' (assuming you extracted them from the app to there).
>>> 
>>> -----
>>> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
>>> http://www.kyngchaos.com/
>>> 
>>> The equator is so long, it could encircle the earth completely once.
>>> 
>> 
>> 
>>> so you need to tell cmake to install dev frameworks with:
>>> 
>>> -D QGIS_MACAPP_INSTALL_DEV=TRUE
>> 
>> tell cake during QGIS building from source? so building the source is my only way in order to build a plugin?! right?
>> 
> I thought that's what you were doing anyways?  But yes, I don't package the dev frameworks with my QGIS installer, so you need to compile QGIS to get them.
> 
> It *may* work if you copy the frameworks out of the QGIS app to /Library/Frameworks.  The main problem I found is some versions of the Xcode tools may fail to link those because of the relative paths embedded in them.
> 
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
> 
> "We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."
> 
> "Don't you even hate 'em?"
> 
> "What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."
> 
> <Ha, ha> "And it might give 'em all stomach ulcers."
> 
> - Tarzan, on war
> 



More information about the Qgis-developer mailing list