[Qgis-developer] Broken code after upgrade to QGIS 1.4

Matthew Denno mgdenno at gmail.com
Fri Jan 22 23:27:37 EST 2010


Hello Martin and others,

I am still having trouble with my application; when I try and to call:
QgsVectorLayer * mypVectorLayer  = new QgsVectorLayer(myLayerPath,
myLayerBaseName, myProviderName); my program ends unexpectedly.  I
have tried to walk through the code and it looks like it never even
gets to the QGIS code but dies in the qatomic_i386.h file with the
inline bool QBasicAtomicInt::ref() function.

I have put together a small Qt project that fails in this way for me.
I am wondering if I could send this project to someone (it is about
130 KiB) who is running Kubuntu 9.10 and QGIS 1.4 and see if they have
the same problem.  I am really stumped.  This all worked fine for me
in the past.  I put the project down for a week or so during which
time I ran updates, installed Spatialite and PostGIS, and upgraded to
QGIS 1.4.  Now it doesn't seem to work, however, QGIS seems to work
fine.  I feel like I must be missing something obvious here.

Thanks,

Matt

On Tue, Jan 19, 2010 at 11:11 PM, Matthew Denno <mgdenno at gmail.com> wrote:
> Martin,
>
> Thanks for replying to my email.
>
> I have done a bit more looking at my problem and it looks like the
> problem really lies (maybe) in the qatomic_i386.h file with the inline
> bool QBasicAtomicInt::ref() function.  If I don't step into the code I
> sent before that is where it fails.  I am using the Qt Creator IDE,
> which I like but seem to have trouble debugging with.
>
> I have answered your questions below, but am not sure if maybe my
> recent findings change things.  I need to do some more Google-ing
> probably.
>
> On Tue, Jan 19, 2010 at 7:03 AM, Martin Dobias <wonder.sk at gmail.com> wrote:
>> Hi Matthew
>>
>> On Tue, Jan 19, 2010 at 5:16 AM, Matthew Denno <mgdenno at gmail.com> wrote:
>>> Hello List,
>>>
>>> Quick question.  The following piece of code seemed to always work
>>> before upgrading to 1.4, but now it seems to fail with this message:
>>>
>>> The program has unexpectedly finished.
>>> /home/matt/Programming/DelaunayIntersection/DelaunayIntersection
>>> exited with code 0
>>>
>>> Any ideas with what the cause might be?  Any help or direction would
>>> be greatly appreciated.
>>
>> Just making sure: have you recompiled your code after upgrade to 1.4?
>
> I am new to C++ so that is a good question, but yes I have recompiled
> my code and it compiled fine.
>
>> Is QGIS 1.4 itself working fine? (e.g. it opens a shapefile without problems)
>
> Yes, seems to work fine.
>
>> Is that a standalone application or a plugin?
>
> It is a stand alone application.
>
>> If it's an application, do you initialize QgsApplication?
>
> I don't initialize QgsApplication.  Is this required?  I didn't do
> this previously either.  My application performs an analysis and
> generates a few shapefiles but does not display them.  On a side note
> I would like to make it a plugin in the future, but am working out
> some other issues first.
>
>> Is the provider path in your code (/usr/lib/qgis) still valid?
>
> Yes it seems to be.
>
>>
>> The code itself looks fine and shouldn't be affected by upgrades.
>> (Except for that you create an instance of QgsVectorLayer and never
>> free it.)
>
> Oops! :-)
>
>>
>> Martin
>>
>


More information about the Qgis-developer mailing list