PDA

View Full Version : QtPositioning introduces an error



Corny
8th March 2017, 14:58
I’m attempting to use the QGeoCoordinate and QGeoRectangle C++ classes. After many linking failures, I finally found that I needed to add the positioning keyword to my .pro file. So I used…

QT += positioning.

After doing this, it would compile just fine but I would receive a segmentation fault error as soon as I tried to run it in debug mode.

I wasn’t sure where the SIGSEGV error was occurring, so I started placing break-points at strategic positions to try and determine at what spot in the code the problem was occurring. Unfortunately, even if I set a break-point at the first line of my main{}, it appeared as if program execution never got to the code I wrote.

Internet searches haven’t seemed to turn up any answers, so I’m hoping someone here may have come across this in the past or may know what my problem is.

I didn't include any code as the problem appears to be something else. I’m using Qt 5.7.0 with MinGW 32 bit from Qt Creator 4.1.0 on an HP Intel Xeon using Windows 7 Professional operating system with service pack 1 installed.

I'd appreciate any insight someone may have on this situation. Thanks in advance.

Santosh Reddy
9th March 2017, 07:22
Do you have any global static objects, or class static objects? Those are initialised before the main is called, put a break point there and check.

Corny
9th March 2017, 16:11
Thanks for your reply Santosh.

The Ui namespace has global scope but I don't have any variables, classes or functions that are declared as static globaly.

I know this wasn't part of your suggestion, but since I'm using the QGraphicsObject class, I do have several pure virtual functions that are const with the declarations modified by the Q_DECL_OVERRIDE macro. So just on a whim, and because I've had issues with const values in the past, I tried breakpoints at those points but execution has never advanced even that far.

Not sure if it will help, but this is the debug dump...

~"Dump of assembler code for function _pei386_runtime_relocator:\n"
~" 0x004059b8 <+0>:\t55\tpush %ebp\n"
~" 0x004059b9 <+1>:\tb9 40 04 45 00\tmov $0x450440,%ecx\n"
~" 0x004059be <+6>:\t89 e5\tmov %esp,%ebp\n"
~" 0x004059c0 <+8>:\teb 14\tjmp 0x4059d6 <_pei386_runtime_relocator+30>\n"
~" 0x004059c2 <+10>:\t8d b6 00 00 00 00\tlea 0x0(%esi),%esi\n"
~" 0x004059c8 <+16>:\t8b 51 04\tmov 0x4(%ecx),%edx\n"
~" 0x004059cb <+19>:\t8b 01\tmov (%ecx),%eax\n"
~" 0x004059cd <+21>:\t83 c1 08\tadd $0x8,%ecx\n"
~"=> 0x004059d0 <+24>:\t01 82 00 00 40 00\tadd %eax,0x400000(%edx)\n"
~" 0x004059d6 <+30>:\t81 f9 f4 04 45 00\tcmp $0x4504f4,%ecx\n"
~" 0x004059dc <+36>:\t72 ea\tjb 0x4059c8 <_pei386_runtime_relocator+16>\n"
~" 0x004059de <+38>:\t5d\tpop %ebp\n"
~" 0x004059df <+39>:\tc3\tret \n"
~" 0x004059e0 <+40>:\t90\tnop\n"
~" 0x004059e1 <+41>:\t90\tnop\n"
~" 0x004059e2 <+42>:\t90\tnop\n"
~" 0x004059e3 <+43>:\t90\tnop\n"
~" 0x004059e4 <+44>:\t90\tnop\n"
~" 0x004059e5 <+45>:\t90\tnop\n"
~" 0x004059e6 <+46>:\t90\tnop\n"
~" 0x004059e7 <+47>:\t90\tnop\n"
~"End of assembler dump.\n"