OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Another C++ Issue
Capn_Fish
post Nov 21 2007, 04:28 PM
Post #1





Group: Members
Posts: 2,350
Joined: 30-July 06
Member No.: 10,575



I'm getting an error:

CODE
terminate called after throwing an instance of 'std::ios_base::failure'
    what():  basic_ios::clear
Aborted


With my latest C++/SDL app. What causes this, and what can I do about it? It works fine on my laptop, but when I try to run it on my Z, I got the above error.

Any help would be much appreciated.
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
Capn_Fish
post Nov 22 2007, 09:49 AM
Post #2





Group: Members
Posts: 2,350
Joined: 30-July 06
Member No.: 10,575



Sure, I'll go put some cout'd numbers in now.

EDIT: Attached source

EDIT2: It's failing between 4 & 5, or in the "ReadMap" function:

EDIT3: Now, after making NO changes other than adding in some debug output, it's just segfaulting (blink.gif) after it tries to move to the last character of the map. I think I've got this now, so, unless you are really bent on helping, go enjoy your Thanksgivings (if you're in the US, otherwise, just enjoy your day).

I should really stop posting these types of issues at night when everything looks hopeless...

Thanks again for your help!

EDIT4: Yup, I got it (one too few characters in my array. Funny that it worked on the laptop...). I'll leave the source up as a teaser.
Attached File(s)
Attached File  dwr_with_debug.tar.gz ( 27.41K ) Number of downloads: 3
 
Go to the top of the page
 
+Quote Post
koan
post Nov 23 2007, 01:26 AM
Post #3





Group: Members
Posts: 328
Joined: 25-February 04
From: UK
Member No.: 2,025



QUOTE(Capn_Fish @ Nov 22 2007, 09:49 AM) *
EDIT3: Now, after making NO changes other than adding in some debug output, it's just segfaulting


When the behaviour of the program changes after making such slight changes that's a clear indication of reading/writing to illegal memory.

You should have run valgrind on the program when compiled on your desktop to make sure there are no obvious errors, it would have caught the problem and told you where it was.
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd July 2014 - 10:17 PM