Results 1 to 7 of 7

Thread: Mixing C and Qt

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mixing C and Qt

    This is a screenshot of the debugging session in KDevelop. It says it cannot access memory at address 0x0. Any ideas?

  2. #2
    Join Date
    Feb 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mixing C and Qt

    And this is a screenshot of the an_GrowReconfigData-method that's called right before the line where the segmentation fault occurs.

    Qt Code:
    1. pInfo->data = (an_Byte*) realloc(pInfo->data, pInfo->capacity);
    To copy to clipboard, switch view to plain text mode 

    I think pInfo->data somehow ends up as 0x0 after the call to realloc. Could this be? And do you have a solution?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Mixing C and Qt

    Based on the first screenshot I take it that "pInfo" of pInfo->data is null. A full backtrace would be nicer though... especially one from a program compiled with -ggdb.

    BTW. You should check the result of realloc...
    Last edited by wysota; 20th February 2006 at 19:29.

  4. #4
    Join Date
    Feb 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mixing C and Qt

    I forgot to call a method at the beginning of my program that initialised data in the first place.

Similar Threads

  1. Mixing character encodings with QSql
    By Barnacle in forum Qt Programming
    Replies: 1
    Last Post: 19th March 2014, 11:08
  2. Mixing QRegExpValidator and input mask and QLineEdit
    By abernat in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2009, 00:04
  3. Problem when mixing openGL and QPainter
    By sanjayshelke in forum Qt Programming
    Replies: 9
    Last Post: 21st March 2008, 12:49
  4. Mixing MFC and Qt
    By Lele in forum Qt Programming
    Replies: 1
    Last Post: 11th May 2006, 14:55
  5. Replies: 11
    Last Post: 24th March 2006, 06:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.