Results 1 to 3 of 3

Thread: Memory could not be read? (runtime) [solved]

  1. #1
    Join Date
    Mar 2008
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Memory could not be read? (runtime) [solved]

    Hi all,

    So, I've just compiled a new version of a program that I've written earlier and that used to work just fine.

    In this new version however, I've changed a lot of stuff.

    It compiles just fine, the only warnings I get are "/* withing comment", so nothing critical.

    When I try to run the program, I get the following error:
    "The instruction at "0x6a340388" referenced memory at "0x00000001". The memory could not be "read". Click Ok to terminate the program, click cancel to debug the program."

    Do you know what I did wrong?

    The code is not too complex, it's just one window, no multiple threads, no file access whatsoever.

    Here some info:
    QT: 4.4.3
    compiling: commandline
    OS: Microsoft Windows XP Professional SP2

    Thanks in advance

    DrDonut
    Last edited by DrDonut; 27th February 2009 at 10:15. Reason: solved

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Memory could not be read? (runtime)

    Hi,

    Compile it as debug and debug it. You will see where is the problem.
    We can't tell you where is the problem without the code.
    A memory access error refers to a bad pointer access.
    Òscar Llarch i Galán

  3. #3
    Join Date
    Mar 2008
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Memory could not be read? (runtime)

    Hi, ^NyAw^

    Thank you for your reply, and for pointing out that it probably had to do something with pointers, you where right.

    Thing was that I tried to add widgets to a grid but had not used the line:
    Qt Code:
    1. grid = new QGridLayout;
    To copy to clipboard, switch view to plain text mode 

    And I also found a connect statement for a timer that didn't exist.

    Thanks for your help!

    DrDonut

Similar Threads

  1. Memory debugging in windows
    By txandi in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2009, 13:45
  2. [Closed] Read an XML file into memory
    By marvaneke in forum Qt Programming
    Replies: 2
    Last Post: 25th March 2008, 15:51
  3. Memory leak weirdness
    By Darhuuk in forum General Programming
    Replies: 10
    Last Post: 10th January 2008, 18:51
  4. QIODevice read()
    By ShaChris23 in forum Newbie
    Replies: 1
    Last Post: 3rd May 2007, 00:29
  5. saving a c string of variable length in a shared memory?
    By nass in forum General Programming
    Replies: 4
    Last Post: 3rd January 2007, 14:40

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.